Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Problems with seemingly simple string matching...

by boftx (Deacon)
on Oct 05, 2013 at 00:09 UTC ( #1056957=note: print w/ replies, xml ) Need Help??


in reply to Problems with seemingly simple string matching...

This is just a guess at this point (just got off work and I'm still sober), and I probably ought to double check the man page, but I'm pretty sure that chomp() will remove only a single whitespace character from the end of the line. Even though the \r\n pair might be considered a single char in other contexts, it is two distinct characters so far as chomp() is concerned.

Update: Well, I guess I just stuck my foot in my mouth. I just checked the man page and it says:

This safer version of chop removes any trailing string that corresponds to the current value of $/ (also known as $INPUT_RECORD_SEPARATOR in the English module).

So kindly disregard my guess. :)

On time, cheap, compliant with final specs. Pick two.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2016-07-28 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (258 votes). Check out past polls.