[Http-webtest-commits] CVS: HTTP-WebTest/lib/HTTP/WebTest Utils.pm,1.3,1.4
Brought to you by:
m_ilya,
richardanderson
From: Ilya M. <m_...@us...> - 2002-06-06 18:29:17
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv3355 Modified Files: Utils.pm Log Message: Added make_sub_in_playground() Index: Utils.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Utils.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Utils.pm 15 May 2002 19:24:42 -0000 1.3 --- Utils.pm 6 Jun 2002 18:29:14 -0000 1.4 *************** *** 51,55 **** @EXPORT_OK = qw(make_access_method find_port copy_dir load_package ! eval_in_playground); =head2 make_access_method($field, $optional_default_value) --- 51,55 ---- @EXPORT_OK = qw(make_access_method find_port copy_dir load_package ! eval_in_playground make_sub_in_playground); =head2 make_access_method($field, $optional_default_value) *************** *** 208,212 **** =head3 Returns ! Return value of evaluated code. =cut --- 208,212 ---- =head3 Returns ! A return value of evaluated code. =cut *************** *** 215,225 **** my $code = shift; ! my $ret = eval <<CODE; package HTTP::WebTest::PlayGround; $code CODE ! return $ret; } --- 215,242 ---- my $code = shift; ! return eval <<CODE; package HTTP::WebTest::PlayGround; + no strict; + local \$^W; # aka no warnings in new perls + $code CODE + } ! =head2 make_sub_in_playground ($code) ! ! Creates anonymous subroutine inside playground package. ! ! =head3 Returns ! ! A reference on anonymous subroutine. ! ! =cut ! ! sub make_sub_in_playground { ! my $code = shift; ! ! return eval_in_playground("sub { local \$^W; $code }"); } |