Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^5: perl 5.10 bug or not?

by Corion (Pope)
on Aug 20, 2013 at 15:58 UTC ( #1050203=note: print w/ replies, xml ) Need Help??


in reply to Re^4: perl 5.10 bug or not?
in thread perl 5.10 bug or not?

See perlre:

NOTE: Failed matches in Perl do not reset the match variables, which makes it easier to write code that tests for a series of more specific cases and remembers the best match.

$1 and $2 have their old values from a match somewhere else in your code.

Always guard use of $1 with an if statement to make sure it matched:

if( m/(.*) <(.*)>/ ) { print "Matched '$1' + '$2'"; } else { print "Did not match"; };


Comment on Re^5: perl 5.10 bug or not?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2014-08-30 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls