From: Rafael Garcia-Suarez Date: Mon, 18 Feb 2002 15:41:26 +0000 (+0100) Subject: bug on "do NUMBER" X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d4a8e56c4dba2cdaeeea4c6a0c703df02a2c74b3;p=p5sagit%2Fp5-mst-13.2.git bug on "do NUMBER" Message-Id: <20020218154126.A692@rafael> p4raw-id: //depot/perl@14741 --- diff --git a/pp_ctl.c b/pp_ctl.c index 14a48c6..c60f7dc 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -2870,7 +2870,7 @@ PP(pp_require) OP *op; sv = POPs; - if (SvNIOKp(sv)) { + if (SvNIOKp(sv) && PL_op->op_type != OP_DOFILE) { if (SvPOK(sv) && SvNOK(sv) && SvNV(sv)) { /* require v5.6.1 */ UV rev = 0, ver = 0, sver = 0; STRLEN len; diff --git a/t/op/do.t b/t/op/do.t index 744a62b..a92a918 100755 --- a/t/op/do.t +++ b/t/op/do.t @@ -31,7 +31,7 @@ sub ok { return $ok; } -print "1..20\n"; +print "1..21\n"; # Test do &sub and proper @_ handling. $_[0] = 0; @@ -87,6 +87,9 @@ ok( !$@, "do on a non-existing file, first try" ); eval qq{ do uc qq(a file that does not exist); }; ok( !$@, "do on a non-existing file, second try" ); +# 6 must be interpreted as a file name here +ok( (!defined do 6) && $!, "'do 6' : $!" ); + END { 1 while unlink("$$.16", "$$.17", "$$.18"); }