HTTP::WebTest::Utils - Some misc staff used by various parts of HTTP::WebTest
use HTTP::WebTest::Utils; use HTTP::WebTest::Utils qw(make_access_method find_port); use HTTP::WebTest::Utils qw(copy_dir load_package); use HTTP::WebTest::Utils qw(eval_in_playground); *method = make_access_method($field); *method = make_access_method($field, $default_value); *method = make_access_method($field, sub { ... }); find_port(hostname => $hostname); copy_dir($src_dir, $dst_dir); load_package($package); my $ret = eval_in_playground($code); die $@ if $@;
This packages contains some subroutines used by various parts of HTTP::WebTest which don't fit any its classes.
Creates anonymouse subroutine which can be used as accessor method. Such method can be used together with objects which are based on blessed hashes.
Typical usage is
*method = make_access_method($field, ...);
$field
A hash field used for created accessor method.
$optional_default_value
If $optional_default_value is a code reference uses values returned by its execution as default for created accessor method. Otherwise uses $optional_default_value as name of method which returns default value for created accessor method.
Free port number for network interface specified by $hostname.
$hostname
Copies directiory recursively.
Loads package unless it is already loaded.
Evaluates perl code inside playground package.
A return value of evaluated code.
Creates anonymous subroutine inside playground package.
A reference on anonymous subroutine.
Copyright (c) 2001,2002 Ilya Martynov. All rights reserved.
This module is free software. It may be used, redistributed and/or modified under the terms of the Perl Artistic License.
HTTP::WebTest
HTTP::WebTest::API
To install HTTP::WebTest, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::WebTest
CPAN shell
perl -MCPAN -e shell install HTTP::WebTest
For more information on module installation, please visit the detailed CPAN module installation guide.