$shared .= ; #### my $local = ; $shared .= $local; #### my $local = ; { lock( $shared ); $shared = $local; } #### { lock( $shared ); my $local = ; $shared = $local; } #### # XXX. The key and value are related. my $string = $shared_key . ' => ' . $shared_value; #### C:\test>perl -MO=Terse my $string = $shared_key . ' => ' . $shared_value; ^Z LISTOP (0x191d964) leave [1] OP (0x191d948) enter COP (0x191d988) nextstate ## exception handler installed here! BINOP (0x191d9c4) sassign ## exception handler entered here and the entire subtree retried <<<------+ ## critical section entered here (on second attempt) | BINOP (0x191d9e8) concat [5] | BINOP (0x191da4c) concat [3] | UNOP (0x191da90) null [15] | PADOP (0x191dab0) gvsv GV (0x182435c) *shared_key | ## Exception triggered here by the access to shared data.-+ SVOP (0x191da70) const [6] PV (0x1824374) " => " UNOP (0x191da0c) null [15] PADOP (0x191da2c) gvsv GV (0x18243b0) *shared_value OP (0x191dad0) padsv [1] ## critical section exited here. - syntax OK #### { lock( $shared ) $local = $shared; $shared = somefunction( $local ); } #### $shared = somefunction( $shared ); #### C:\test>perl -MO=Terse sub somefunction{ $_[0] + 1 } $shared = somefunction( $shared ); ^Z LISTOP (0x191d7e0) leave [1] OP (0x191d7c4) enter COP (0x191d804) nextstate ## install exception handler here BINOP (0x191d840) sassign ## Exception handler catches here <<<<---------------------------^ ## Critical section entered here at second attempt UNOP (0x191d864) entersub [4] UNOP (0x191d8a0) null [141] OP (0x191d884) pushmark UNOP (0x191d8c4) null [15] PADOP (0x191d8e4) gvsv GV (0x22507c) *shared ## Exception raised here---------------------------^ UNOP (0x191d904) null [17] PADOP (0x191d924) gv GV (0x225088) *somefunction UNOP (0x191d944) null [15] PADOP (0x191d964) gvsv GV (0x22507c) *shared ## ExitCriticalSection here. - syntax OK