01 Feb 2019 18:31:43 UTC
- Distribution: WWW-Mechanize-Pluggable
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (0)
- Testers (424 / 0 / 0)
- KwaliteeBus factor: 1
- % Coverage
- License: unknown
- Activity24 month
- Download (26.05KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionMCMAHON Joe McMahonand 1 contributors
- Joe McMahon
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
WWW::Mechanize::Plugin::HelloWorld - a sample WWW::Mechanize::Pluggable plugin
use WWW::Mechanize::Pluggable; # This module is automatically loaded into WWW::Mechanize::Pluggable
This module shows how to mess with the
WWW::Mechanizeobject contained within the
Further refinements are left to the reader. Note that the fields in the
WWW::Mechanize::Pluggableobject are also available to the plugins.
my $mech = new WWW::Mechanize::Pluggable; $mech->hello_world; # $mech->content now eq 'hello world'
Contact the author at
Joe McMahon firstname.lastname@example.org
Copyright 2005 by Joe McMahon and Yahoo!
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
This function snags any 'helloworld' key-value pair off the
use WWW::Mechanizeline and sets the
HELLOkey to it.
Currently this uses a global variable in the
WW::Mechanize::Pluggablenamespace to capture the value. This is icky and should be replaced with something more elegant.
hello_worldinto the caller's namespace.
Just a demonstration function; replaces the current content with 'hello world'. It should be noted that this is not going to pass most tests for "successfully fetched page" because
WWW::Mechanizehasn't processed a valid request-response pair.
Module Install Instructions
To install WWW::Mechanize::Pluggable, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install WWW::Mechanize::Pluggable
For more information on module installation, please visit the detailed CPAN module installation guide.