Google News
logo
Perl - Interview Questions
Explain what is Chop and Chomp function does?
Chop function eliminates the last character from expr, each element of the list

Chomp function eliminates the last character from an expr or each element of the list if it matches the value of $/. It is considered better than chop as it only removes the character if there is a match.
Advertisement