Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Code is giving "explicit package name required" error

by LanX (Chancellor)
on Mar 23, 2013 at 14:21 UTC ( #1025035=note: print w/replies, xml ) Need Help??


in reply to Re: Code is giving "explicit package name required" error
in thread Code is giving "explicit package name required" error

> > Global symbol "$cmd" requires explicit package name at ...

> That means you have a variable "$cmd" on line 32, which you failed to declare with my $cmd or a similar statement.

I wonder if nowadays the error message shouldn't be updated to something "requires explicit package name or lexical "my" declaration ..."

Lexicals replaced package vars as a standard long ago, maybe the feedback should reflect the most probable cause.

I'm aware that changing the message might confuse some parsers, but it's such a common question here that it's worth a rethink.

Cheers Rolf

( addicted to the Perl Programming Language)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025035]
help
Chatterbox?
[Lady_Aleena]: marioroy, it has 3 subroutines which can be fed data to generate random things. See here.
[Lady_Aleena]: marioroy, it is used in 24 other modules I wrote.
[Lady_Aleena]: GUH! I wrote a script better than I thought! 8)

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2017-05-29 09:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?