=over
=item chop VARIABLE
=item chop LIST
=item chop
Chops off the last character of a string and returns the character
chopped. It's used primarily to remove the newline from the end of an
input record, but is much more efficient than C because it neither
scans nor copies the string. If VARIABLE is omitted, chops C<$_>.
Example:
while (<>) {
chop; # avoid \n on last field
@array = split(/:/);
#...
}
You can actually chop anything that's an lvalue, including an assignment:
chop($cwd = `pwd`);
chop($answer = );
If you chop a list, each element is chopped. Only the value of the
last C is returned.
Note that C returns the last character. To return all but the last
character, use C.
=back