Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Variable declaration

by Ovid (Cardinal)
on Oct 17, 2011 at 15:14 UTC ( [id://931947]=note: print w/replies, xml ) Need Help??


in reply to Variable declaration

In addition to the other comments, I recommend new programmers also use diagnostics. Not only does that give you more information about the error, it also gives you suggestions on how to fix it. Here's the output I get when I include that:

Global symbol "$another_variable" requires explicit package name at di +ag.pl line 6. Execution of diag.pl aborted due to compilation errors (#1) (F) You've said "use strict" or "use strict vars", which indicates + that all variables must either be lexically scoped (using "my" or +"state"), declared beforehand using "our", or explicitly qualified to say which package the global variable is in (using "::"). Uncaught exception from user code: Global symbol "$another_variable" requires explicit package na +me at diag.pl line 6. Execution of diag.pl aborted due to compilation errors. at diag.pl line 6

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-20 03:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found