Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: chomp() is confusing

by davido (Archbishop)
on May 15, 2006 at 06:56 UTC ( #549387=note: print w/replies, xml ) Need Help??


in reply to Why chomp() is not considering carriage-return

chomp removes any trailing string that corresponds to the contents of the special variable $/

You shouldn't, under most circumstances, need to worry whether a specific platform uses \r\n or \n. Perl generally uses \n as the logical newline, and adapts to whatever platform it's being used on. You can read up on this topic in perlport.

About the only times you have to worry about cross-platform line ending issues are when you're reading documents written on one platform, from another platform; and also when you've moved a script from one platform to another without properly converting the script's own line endings.


Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://549387]
help
Chatterbox?
[Dumu]: and incidentally, in case you're dying to know, it's multiple web browser bookmark format files...
[ambrus]: Seeking afterwards might also work fine, I think.

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2017-11-20 18:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (291 votes). Check out past polls.

    Notices?