- or download this
use vars qw(%friends);
- or download this
sub getFriends {
# Initializes my little hash
our %friends = (Paul => 1, Suzie => 1);
return %friends;
}
- or download this
use Friends;
my %friends = &getFriends(); # for lexical scope
- or download this
require "outsidefile";
print %friends;
- or download this
#
# guess what? I'm in main's scope !!!
#
%friends = (Paul => 1, Suzie => 1);