There's more than one way to do things | |
PerlMonks |
Re: When do you use chop insetad of comp?by webadept (Pilgrim) |
on Mar 02, 2002 at 20:09 UTC ( [id://148879]=note: print w/replies, xml ) | Need Help?? |
Chop removes the last character, no matter what it is, EOL, or what ever. Chomp only removes EOL marks if there is one. If not, it does nothing. The EOL mark Chomp removes corresponds to the current value of $/, so you may want to check that as well on your system. Chomp also returns the total number of characters removed so you get a 1 or a 0 responce. Chop returns nothing. webadetp.net
In Section
Seekers of Perl Wisdom
|
|