Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
Quick and easy question i'm sure, but how can I chop off the last 4 characters from a string using chop.
I can do this:
chop($string); chop($string); chop($string); chop($string);
Thats a little bit ugly though.
I realise I can probably use substr, but wondered if there was a cool way to do it with chop.
Thanks,
Tom
Back to
Seekers of Perl Wisdom