sidhekin@blackbox:~$ perl -v This is perl, v5.8.7 built for i486-linux Copyright 1987-2005, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. sidhekin@blackbox:~$ perl sub mychop(\$) { chop ${shift()} } foreach my $thing (qw/foo bar baz/) { print "$thing -> "; my $c = mychop $thing; print " $thing,$c\n"; } __END__ Modification of a read-only value attempted at - line 1. foo -> #### # v5.8.3 built for i386-linux-thread-multi: -bash-2.05b$ perl -le 'print map{chop$$_, $_}\$_, \$_, \$_ for "abc", ($x="abc")' cSCALAR(0x804cbb8)cSCALAR(0x804cc78)cSCALAR(0x804c99c) cSCALAR(0x805f69c)bSCALAR(0x805f69c)aSCALAR(0x805f69c) # v5.8.7 built for i486-linux: sidhekin@blackbox:~$ perl -le 'print map{chop$$_, $_}\$_, \$_, \$_ for "abc", ($x="abc")' Modification of a read-only value attempted at -e line 1. Attempt to free unreferenced scalar: SV 0x812ec2c.