home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


chomp

chomp $
var

chomp @
list

Removes any line-ending characters of a string in $ var , or each string in @ list , that correspond to the current value of $/ (not just any last character, as chop does). chomp returns the number of characters deleted. If $/ is empty (in paragraph mode), chomp removes all newlines from the selected string (or strings, if chomp ing a list ). If no argument is given, the function chomp s the $_ variable.


Previous: Reference: chmod Perl in a Nutshell Next: Reference: chop
Reference: chmod Book Index Reference: chop

Library Navigation Links

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