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 reply to Re: chop and chomp
by ELISHEVA
in thread chop and chomp
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |