Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Confusing regex match.

by graff (Chancellor)
on Oct 23, 2013 at 01:31 UTC ( #1059261=note: print w/ replies, xml ) Need Help??


in reply to Confusing regex match.

My best guess is that the file contains CRLF line termination, and you're running the perl script on a non-CRLF system (unix, linux, macosx). Observe:

perl -e 'print "pl\r\n"' > /tmp/j.txt perl -e 'open(I,"/tmp/j.txt");$/=undef;$_=<I>; print ". matches CR on $^O\n" if(/p.{2,6})'
For me, that yields ". matches CR on darwin".


Comment on Re: Confusing regex match.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (14)
As of 2015-07-07 18:46 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 (93 votes), past polls