Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Variable declaration

by Eliya (Vicar)
on Oct 14, 2011 at 07:14 UTC ( #931442=note: print w/ replies, xml ) Need Help??


in reply to Re: Variable declaration
in thread Variable declaration

$another_variable is a lexical variable...

Strictly speaking, $another_variable (as the OP has it) isn't a lexical variable.  my declares a lexical variable — no my, no lexical variable... (maybe you meant to say it should be a lexical variable?).

In the OP's case, both variables are package variables, it's just that strictures do not complain if you use the fully-qualified form, even if the variable is otherwise undeclared (the idea being that you know what you're doing if you spell it this way).


Comment on Re^2: Variable declaration
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2015-07-08 06:59 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 (96 votes), past polls