Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Note on usage of ours variables and a question

by LanX (Sage)
on Nov 20, 2019 at 17:52 UTC ( #11108948=note: print w/replies, xml ) Need Help??


in reply to Note on usage of ours variables and a question

> I would like to avoid qualification with package name a variable that I use in many modules in many situations. For example, variable debug.

TIMTOWTDI

The following makes the variable $Debug::DEBUG available as $DEBUG for the rest of the file

use strict; use warnings; package Debug; our $DEBUG; package MyPkg; print $DEBUG if $DEBUG;

but I'd rather use a constant.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2021-10-21 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (83 votes). Check out past polls.

    Notices?