Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: What's happening to my $1?

by Anonymous Monk
on Jan 21, 2004 at 05:09 UTC ( [id://322788]=note: print w/replies, xml ) Need Help??


in reply to What's happening to my $1?

In your second set of data, the "Xyz" causes the engine to start matching with the "X", but the rest of the string causes the match to fail, and thus the last read match is $1, i.e. "FOO". However, since the matching engine started a new match, the number of matched characters was reset, so that essentially there is only one valid character reported; hence, what's available in $1 is "F". Personally, I wouldn't rely on what is not matched in $1, but would rather re-evaluate the string should the initial match fail. YMMV. TMTOWTDI.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (8)
As of 2024-04-25 11:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found