Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: regex with multiple matches, missing first match?

by agentv (Friar)
on Apr 22, 2003 at 12:35 UTC ( [id://252250]=note: print w/replies, xml ) Need Help??


in reply to regex with multiple matches, missing first match?

...this is just a guess, but I believe that whether you quote the assignment string or not makes all the difference in the world. (Although in my tests, the interpreter choked unless I supplied quotes.)

But presuming that quotes are not necessary in some contexts, here is what could happen.

The OR operator, "|" has a higher precedence than the assignment, so the fragment "1 | 0.116" yields "1". That would account for the anomaly that you describe.

On the other hand again, I could not get your assignment instruction to run under 5.6 using the debugger interactively. So I have to reiterate the wonder about there being any output at all from your program.

...All the world looks like -well- all the world, when your hammer is Perl.
---v

  • Comment on Re: regex with multiple matches, missing first match?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-24 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found