Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: chop and chomp

by ELISHEVA (Prior)
on Mar 17, 2009 at 21:30 UTC ( #751289=note: print w/replies, xml ) Need Help??


in reply to chop and chomp

Chomp is generally recommended over chop because chop can have unexpected results. For example, suppose all but the last line of a file ends in a new line. chomp will leave the last line intact (since it only removes $/) but chop will remove the last letter of the last line since it blindly removes the last character, whatever it is - probably not what you want.

Best, beth

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://751289]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2023-01-29 04:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?