RosettaCodeData/Task/Substring-Top-and-tail/Perl/substring-top-and-tail-2.pl

5 lines
196 B
Perl
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
$string = 'ouch';
$bits = chop($string); # The last letter is returned by the chop function
print $bits; # h
print $string; # ouc # See we really did chop the last letter off