http://qs1969.pair.com?node_id=135530


in reply to chop() and chomp()

perlfunc Describes both chop and chomp, with good examples and excellent detailed explanations.
I downvoted the tutorial, because it adds nothing to the existing documentation and thus only makes things harder for beginners.

  1. Why did you use $a instead of $_?
  2. print Doesn't return it's given attributes, it returns true if succesful. All your "would return" comments are wrong.
  3. You didn't even chomp arrays or hashes.

2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$