$foo = "x"; &mod($foo); for ($x = 0; $x < 3; $x++) { &mod("a"); } sub mod { print "before: $_[0]"; $_[0] = "m"; print " after: $_[0]\n"; } #### Modification of a read-only value attempted... #### eval { $_[0] .= '' }; if ($@ =~ /Modification of a read-only value attempted/) { #### $ perl -MDevel::Peek -le 'Dump("hello")' SV = PV(0x8121a3c) at 0x812b36c REFCNT = 1 FLAGS = (POK,READONLY,pPOK) PV = 0x812f498 "hello"\0 CUR = 5 LEN = 6