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

Re: (Ovid) Re: Detecting scoping/namespace conflicts

by gregw (Beadle)
on Apr 04, 2002 at 12:35 UTC ( [id://156641]=note: print w/replies, xml ) Need Help??


in reply to (Ovid) Re: Detecting scoping/namespace conflicts
in thread Detecting scoping/namespace conflicts

I didn't mean to re-use the variable name. What happened is that originally I was just using it in the inner scope, and then when I started realizing I needed it in the outer scope, I forgot to remove the initialization from the inner scope.

And one clarification; probably a mistaken simplification on my part in my example. I was using $pkgname::usefuldata in my code, not just a plain $usefuldata... something I resorted to when trying to move a cron script I created into a web application.

So really, to avoid this in the future, I have to write and keep rewriting my code to use 'my' all the time, rather than expecting some compile time or run-time checking to warn me. Is that basically right?

  • Comment on Re: (Ovid) Re: Detecting scoping/namespace conflicts

Log In?
Username:
Password:

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

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

    No recent polls found