Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^7: Error: Use of uninitialized value $item in concatenation (.) or string at...

by ig (Vicar)
on Jun 13, 2011 at 10:26 UTC ( #909359=note: print w/ replies, xml ) Need Help??


in reply to Re^6: Error: Use of uninitialized value $item in concatenation (.) or string at...
in thread Error: Use of uninitialized value $item in concatenation (.) or string at...

Basically, $1 and $2 only become 'undef'-ed when there is a un*successful* match.

I'm not sure what you mean by "un*successful*", but it is likely to be (mis-)understood to mean something that is incorrect.

AnomalousMonk has told you correctly. To emphasize where I think you may have gone wrong (or at least easily misunderstood as wrong) I might rewrite what you wrote as:

Basically, $1 and $2 only become 'undef'-ed when there is a successful match and the matching expressions do not include any bracketing constructs "(...)" containing expressions that matched .

That's not an elegant statement, and it may be more confusing than helpful, but it avoids the suggestion that an unsuccessful match might change the match variables ($1, $2, etc.).


Comment on Re^7: Error: Use of uninitialized value $item in concatenation (.) or string at...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2015-07-08 06:08 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 (94 votes), past polls