XP is just a number | |
PerlMonks |
Re: chop and chompby ELISHEVA (Prior) |
on Mar 17, 2009 at 21:30 UTC ( [id://751289]=note: print w/replies, xml ) | Need Help?? |
Chomp is generally recommended over chop because chop can have unexpected results. For example, suppose all but the last line of a file ends in a new line. chomp will leave the last line intact (since it only removes $/) but chop will remove the last letter of the last line since it blindly removes the last character, whatever it is - probably not what you want. Best, beth
In Section
Seekers of Perl Wisdom
|
|