Some days ago, I've interested in the using of 'our' var, 
however, I do have some problem on using this with require.

### Lib 1 ###
use strict;
our %abc;
$abc{a} = 1;
$abc{b} = 2;
### EOF Lib 1 ###

### Lib 2 ###
use strict;    
our $a = "ME";
### EOF Lib 2 ###

### Script 1 ###
use strict;
eval { require "lib1.pl" } or die "lib 1";
eval { require "lib2.pl" } or die "lib 2";

print $abc{a};
### EOF Script 1 ###

When I run script 1, Perl throws me the err of 'explicit package', 
but if I change to print $a, instead of $abc{a}, I got  "ME" correctly... 
Why ?

Besides, how can I make some hash just like %ENV, so can access
everywhere ?

Rgds, 
Connie

Reply via email to