Keep It Simple, Stupid | |
PerlMonks |
Re: chop is chopping off the last letterby plaid (Chaplain) |
on Jul 05, 2000 at 23:51 UTC ( [id://21209]=note: print w/replies, xml ) | Need Help?? |
I don't quite understand your question. You're chopping
a variable, but you don't want it to chop off the last
letter? If you don't want it to chop off the last letter,
then why are you chopping at all? The way to fix it would
just be to not chop.
If what you want is to get rid of any trailing newlines, but not do anything if there aren't any, take a look at chomp, which is a more intelligent version of chop.
In Section
Seekers of Perl Wisdom
|
|