Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

schwern (1528)

schwern
  (email not shown publicly)
http://schwern.net/
AOL IM: MichaelSchwern (Add Buddy, Send Message)
Jabber: schwern@gmail.com

Schwern can destroy CPAN at his whim.

Journal of schwern (1528)

Thursday August 30, 2007
08:23 AM

Blast from the past: your.pm

[ #34282 ]

I was bored so I looked through my module list for something that hasn't been updated in a while. your.pm hasn't been touched since 2001 and its still a good idea. So I just spiffied it up a little and released 1.00.

your.pm solves this problem:


require Some::Module;

$Some::Module::Global = 42;

Perl will warn you Name "Some::Module::Global" used only once: possible typo and the usual work around is often something weird like $Some::Module::Global = $Some::Module::Global = 42. Rare but annoying and the work arounds are odd and varied.

Long ago there was a move to patch vars.pm to accept fully qualified variables but it didn't go through in. So I hacked up your.pm instead, stealing liberally from vars.pm's magic. With your.pm you can explicitly declare that you're going to use someone else's variables at compile time so Perl doesn't think you typo'd.


require Some::Module;
use your qw($Some::Module::Global);

$Some::Module::Global = 42;

Simp.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.