in reply to chop and chomp
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