1#!./perl -w 2 3BEGIN { 4 chdir 't' if -d 't'; 5 require './test.pl'; 6 set_up_inc('../lib'); 7} 8 9use strict; 10 11eval 'my $_'; 12like $@, qr/^Can't use global \$_ in "my" at /; 13 14{ 15 # using utf8 allows $_ to be declared with 'my' 16 # GH #18449 17 use utf8; 18 eval 'my $_;'; 19 like $@, qr/^Can't use global \$_ in "my" at /; 20} 21 22done_testing; 23