Test::WWW::Mechanize::Driver::MagicValues - Define Magic Value classes
Stringification of a scalar reference in this class will slurp the file whose name was stored in the reference.
my $file = "Foo.txt"; print bless(\$file, "FileContents"); # prints contents of Foo.txt
Stringification of a scalar reference in this class will pass the text of the reference through Template.pm. Some useful variables will be defined.
my $tmpl = "[% now.strftime('%Y-%m-%d') %]"; print bless(\$tmpl, "ApplyTemplate"); # prints current date
The value of $Test::WWW::Mechanize::Driver::CURRENT_GROUP
$Test::WWW::Mechanize::Driver::CURRENT_GROUP
The current date as a DateTime object.
my @stack = ( "Foo.txt", "FileContents", "ApplyTemplate" ); print bless(\@stack, "Stacked"); # fills in and prints template in Foo.txt
Dean Serenevy dean@serenevy.net http://dean.serenevy.net/
This software is hereby placed into the public domain. If you use this code, a simple comment in your code giving credit and an email letting me know that you find it useful would be courteous but is not required.
The software is provided "as is" without warranty of any kind, either expressed or implied including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
perl(1).
To install Test::WWW::Mechanize::Driver, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::WWW::Mechanize::Driver
CPAN shell
perl -MCPAN -e shell install Test::WWW::Mechanize::Driver
For more information on module installation, please visit the detailed CPAN module installation guide.