From: Nicholas Clark Date: Thu, 8 Oct 2009 19:05:34 +0000 (+0200) Subject: Move &do_require to the top of require.t, so that @a is the first lexical. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9e7c6af37d3320462cbceb74b487ade8224b9191;p=p5sagit%2Fp5-mst-13.2.git Move &do_require to the top of require.t, so that @a is the first lexical. The relevant line, with comment, is: my @a; # magic guard for scope violations (must be first lexical in file) --- diff --git a/t/comp/require.t b/t/comp/require.t index 032a147..0a2293b 100644 --- a/t/comp/require.t +++ b/t/comp/require.t @@ -6,6 +6,13 @@ BEGIN { push @INC, '../lib'; } +sub do_require { + %INC = (); + write_file('bleah.pm',@_); + eval { require "bleah.pm" }; + my @a; # magic guard for scope violations (must be first lexical in file) +} + # don't make this lexical $i = 1; @@ -19,13 +26,6 @@ my $total_tests = 49; if ($Is_EBCDIC || $Is_UTF8) { $total_tests -= 3; } print "1..$total_tests\n"; -sub do_require { - %INC = (); - write_file('bleah.pm',@_); - eval { require "bleah.pm" }; - my @a; # magic guard for scope violations (must be first lexical in file) -} - sub write_file { my $f = shift; open(REQ,">$f") or die "Can't write '$f': $!";