Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: chop and chomp

by ELISHEVA (Prior)
on Mar 17, 2009 at 21:30 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-25 05:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found