Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Variable declaration

by Ovid (Cardinal)
on Oct 17, 2011 at 15:14 UTC ( #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 line 6. Execution of 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 line 6. Execution of aborted due to compilation errors. at line 6

Comment on Re: Variable declaration
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2015-11-25 19:11 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (686 votes), past polls