Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: chop and chomp

by manoj_speed (Vicar)
on Mar 17, 2009 at 13:50 UTC ( #751195=note: print w/ replies, xml ) Need Help??


in reply to chop and chomp

chop is used to remove the last character,chomp function removes only line endings.

chop removes the last character and returns the character chopped. Chomp removes any trailing string that corresponds to the current value of $/ and returns number of characters removed.


Comment on Re: chop and chomp
Replies are listed 'Best First'.
Re^2: chop and chomp
by ikegami (Pope) on Mar 17, 2009 at 14:04 UTC

    chomp function removes only line endings

    Only for a very specific definition of line endings. That's misleading. It won't even remove a Windows line ending (CRLF) on a Windows machine by default. Nor would you want it to do so.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2015-07-30 09:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls