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

Re^3: Multiple Package in one file with equal named variables

by Roy Johnson (Monsignor)
on Jan 30, 2006 at 17:06 UTC ( [id://526487]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Multiple Package in one file with equal named variables
in thread Multiple Package in one file with equal named variables

The usual way of dealing with warnings for things that you intend to do is to turn off warnings around the offending statement. Often that's done for a lexical scope, but since you don't want to introduce multiple lexical scopes, you'd do:
no warnings 'misc'; my @values = (...); use warnings 'misc';
At this point, you're probably at the point that wrapping each package in its own lexical scope looks like the Right Thing To Do. It is.

For reference, perldoc perllexwarn shows the various categories of warnings you can turn on and off, and perldoc perldiag lists some of the warning messages and which category they fall into. (I found it odd that the "masks earlier declaration" didn't fall under the "redefine" category, and instead was thrown into "misc".)


Caution: Contents may have been coded under pressure.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-16 20:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found