Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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.


Comment on Re: Problems with seemingly simple string matching...
Select or Download Code

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 perusing the Monastery: (4)
As of 2014-12-27 01:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls