in reply to Re^2: Variables in a single file
in thread Variables in a single file
...can lead to "undefined variable"-warnings
Could you provide an example? I think you're fine as long as you make sure the code has loaded/compiled before you access the variables (using use or require within a BEGIN block):
---- X.pm ---- $::foo = "foo"; $::bar = "bar"; -------------- #!/usr/bin/perl use strict; use warnings; use X; # or BEGIN { require X; } print "$::foo\n"; # no warnings
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Variables in a single file
by LanX (Saint) on Sep 16, 2009 at 16:53 UTC |