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

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

by moritz (Cardinal)
on Mar 04, 2009 at 12:55 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://748120]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found