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

Re: Bug? Use of uninitialized value $1 in substitution iterator

by moritz (Cardinal)
on Mar 04, 2009 at 12:55 UTC ( #748120=note: print w/ replies, xml ) Need Help??


in reply to Bug? Use of uninitialized value $1 in substitution iterator

No, the regex engine has it right. Since the capturing group didn't match, $1 is undef. If $1 contained the empty string, it would mean that the associated capturing group matched a zero-length string (not possible in your example, but in general it's possible).

I don't see a reason to change the regex though, if it does what you want. Just switch off the warning.


Comment on Re: Bug? Use of uninitialized value $1 in substitution iterator
Re^2: Bug? Use of uninitialized value $1 in substitution iterator
by clinton (Priest) on Mar 04, 2009 at 13:00 UTC

    OK, fair enough. This same code started throwing up errors today which it wasn't throwing before - I'd refactored some other code around it - so it had me worried.

    My solution was, as you suggest, to turn of those warnings.

    thanks Moritz

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2015-07-05 13:28 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 (67 votes), past polls