package mylib; use strict; use warnings; use Exporter; use vars qw(@ISA @EXPORT); @ISA = qw(Exporter); @EXPORT = qw( load_hash ); sub mylib::load_hash { my $href = shift; for (1..1000) { $$href{$_} = $_; } } #### #!/usr/local/bin/perl use strict; use warnings; use mylib; my %hash; mylib::load_hash(\%hash); for (keys %hash) { print "key: $_ value: $hash{$_}\n"; }