diff options
Diffstat (limited to 't/op')
-rw-r--r-- | t/op/mydef.t | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/t/op/mydef.t b/t/op/mydef.t index 700a3dc5f7..0770e78f0b 100644 --- a/t/op/mydef.t +++ b/t/op/mydef.t @@ -5,7 +5,7 @@ BEGIN { @INC = '../lib'; } -print "1..56\n"; +print "1..64\n"; my $test = 0; sub ok ($$) { @@ -66,6 +66,23 @@ $_ = "global"; ok( our $_ eq 'global', '...our $_ restored outside for my $_' ); } { + my $_ = 'local'; + for ("implicit foo") { # implicit "my $_" + ok( $_ eq "implicit foo", 'for implicit my $_' ); + /(.)/; + ok( $1 eq "i", '...m// in for implicity my $_' ); + ok( our $_ eq 'global', '...our $_ inside for implicit my $_' ); + } + ok( $_ eq 'local', '...my $_ restored outside for implicit my $_' ); + ok( our $_ eq 'global', '...our $_ restored outside for implicit my $_' ); +} +{ + my $_ = 'local'; + ok( $_ eq "postfix foo", 'postfix for' ) for 'postfix foo'; + ok( $_ eq 'local', '...my $_ restored outside postfix for' ); + ok( our $_ eq 'global', '...our $_ restored outside postfix for' ); +} +{ for our $_ ("bar") { ok( $_ eq "bar", 'for our $_' ); /(.)/; |