start page | rating of books | rating of authors | reviews | copyrights

Programming Perl

Programming PerlSearch this book
Previous: 3.2.12 chmod Chapter 3
Functions
Next: 3.2.14 chop
 

3.2.13 chomp

chomp 

VARIABLE

 chomp 

LIST

 chomp

This is a slightly safer version of chop (see below) in that it removes only any line ending corresponding to the current value of $/ , and not just any last character. Unlike chop , chomp returns the number of characters deleted. If $/ is empty (in paragraph mode), chomp removes all trailing newlines from the selected string (or strings, if chomping a LIST ).


Previous: 3.2.12 chmod Programming Perl Next: 3.2.14 chop
3.2.12 chmod Book Index 3.2.14 chop