in reply to Re: Re: Creating hashes into a module.
in thread Creating hashes into a module.

If you like to export all into the callers namespace put
@EXPORT = qw (loadwords %some_words);
into your module code. But this is not a good idea. what about returning a reference to the new created %somewords?
sub loadwords { my @words = qw(a able about above across actually after again all) +; my %some_words; foreach (@words) { $some_words{$_} = "1"; } return \%some_words; }
Boris

Replies are listed 'Best First'.
References.
by vitojph (Acolyte) on Feb 20, 2004 at 13:56 UTC

    I like this solution. I think I'm gonna use references to the hash.

    Thank you everybody.

    Res publica non dominetur.