Note that both chomp() and chop() modify their argument in-place and return the removed character.
No, only chop returns the removed character. chomp returns the total number of characters removed.
Edit: Made first sentence more specific.
In reply to Re^2: How to remove last character of a line
by haukex
in thread How to remove last character of a line
by suvendra123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |