use strict; use warnings; use Devel::Peek; my $i = 0; { my $x = "foo"; sub bbtest { $x .= " bar"; print "subroutine: ", $x, $/; } } { my $x = "foo"; SUB_BBTEST: { Dump($x); $x .= " bar"; print "bareblock : ", $x, $/; } } goto SUB_BBTEST while $i++ < 3; bbtest() while $i++ < 7; #### __output__ SV = PV(0x80fbe38) at 0x8108048 REFCNT = 1 FLAGS = (PADBUSY,PADMY,POK,pPOK) PV = 0x8101be0 "foo"\0 CUR = 3 LEN = 4 bareblock : foo bar SV = PV(0x80fbe38) at 0x8108048 REFCNT = 1 FLAGS = (PADBUSY,PADMY) PV = 0x8101be0 "foo bar"\0 CUR = 7 LEN = 8 bareblock : bar SV = PV(0x80fbe38) at 0x8108048 REFCNT = 1 FLAGS = (PADBUSY,PADMY,POK,pPOK) PV = 0x8101be0 " bar"\0 CUR = 4 LEN = 8 bareblock : bar bar SV = PV(0x80fbe38) at 0x8108048 REFCNT = 1 FLAGS = (PADBUSY,PADMY,POK,pPOK) PV = 0x8101be0 " bar bar"\0 CUR = 8 LEN = 9 bareblock : bar bar bar subroutine: foo bar subroutine: foo bar bar subroutine: foo bar bar bar