[Http-webtest-commits] CVS: HTTP-WebTest/lib/HTTP/WebTest Utils.pm,1.2,1.3
Brought to you by:
m_ilya,
richardanderson
From: Ilya M. <m_...@us...> - 2002-05-15 19:24:56
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv6844/lib/HTTP/WebTest Modified Files: Utils.pm Log Message: Added sub eval_in_playground() Index: Utils.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Utils.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Utils.pm 12 May 2002 13:35:35 -0000 1.2 --- Utils.pm 15 May 2002 19:24:42 -0000 1.3 *************** *** 12,15 **** --- 12,16 ---- 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); *************** *** 23,26 **** --- 24,30 ---- load_package($package); + my $ret = eval_in_playground($code); + die $@ if $@; + =head1 DESCRIPTION *************** *** 45,49 **** use vars qw(@EXPORT_OK); ! @EXPORT_OK = qw(make_access_method find_port copy_dir load_package); =head2 make_access_method($field, $optional_default_value) --- 49,55 ---- use vars qw(@EXPORT_OK); ! @EXPORT_OK = qw(make_access_method find_port ! copy_dir load_package ! eval_in_playground); =head2 make_access_method($field, $optional_default_value) *************** *** 194,197 **** --- 200,225 ---- die $@ if $@; + } + + =head2 eval_in_playground ($code) + + Evaluates perl code inside playground package. + + =head3 Returns + + Return value of evaluated code. + + =cut + + sub eval_in_playground { + my $code = shift; + + my $ret = eval <<CODE; + package HTTP::WebTest::PlayGround; + + $code + CODE + + return $ret; } |