Reference: chop (Perl in a Nutshell)

Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: Reference: chompChapter 5
Function Reference
Next: Reference: chown
 

chop

chop $var
chop @list

Chops off the last character of a string contained in the variable $var (or strings in each element of a @list) and returns the character chopped. The chop operator is used primarily to remove the newline from the end of an input record, but is more efficient than s/\n$//. If no argument is given, the function chops the $_ variable.


Previous: Reference: chompPerl in a NutshellNext: Reference: chown
Reference: chompBook IndexReference: chown

Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.