Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Weird hash access problem

by jfroebe (Parson)
on May 26, 2011 at 18:32 UTC ( #906875=note: print w/ replies, xml ) Need Help??


in reply to Weird hash access problem

The scope of "$1" with respect to the regular expression is within the if block IIRC. Who knows what "$1" is outside of if block. Btw, you forgot "use warnings;" after "use strict;"

Jason L. Froebe

Blog, Tech Blog


Comment on Re: Weird hash access problem
Replies are listed 'Best First'.
Re^2: Weird hash access problem
by ikegami (Pope) on May 26, 2011 at 18:33 UTC
    It's being used in the same block as the one in which it's set.

      Interesting. I would have thought that the scope of what is in the if (...) would be only within the if (...) { } code block. The fact that it works doesn't mean the code should be written that way IMHO.

      Jason L. Froebe

      Blog, Tech Blog

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (15)
As of 2015-07-31 12:25 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 (277 votes), past polls