#!/bin/perl5 use strict; use warnings; my %hash = ( one => 1, two => 2, ); my_sub(%hash); sub my_sub{ my %hash = @_; for my $key (keys %hash){ print "$key -> $hash{$key}\n"; } }