Actually, that's what I meant when I said, "If you have them in a namespace other then main::, then you'll either want to use our (5.6+) or use vars($^V<5.6)."
With out playing games with the import() method or Exporter, you can get to package globals by fully specifying the package name. ie:
use strict; # I can't emphasize that enough!
{
package Common;
use vars qw/ $Var1 @Var2 /;
$Var1 = "some value";
@Var2 = ( 1, 2, 3);
if( $^V =~ m/^5\.6/ )
{
our $Var3 = "The 5.6 way to do the above";
}
}
# Now in main:: name space
print $Common::Var1;
print reverse @Common::Var2;
| [reply] [d/l] |