use strict; use warnings; my %hash = (one => "one", two => "two", three => "three" ); print "$hash{one}\n"; test(); exit; sub test { for (keys %main::hash) { print "$_ $main::hash{$_}\n"; } }