#!usr/bin/perl -w ## shamelessly copied from Marshall use strict; use Data::Dumpe qw/Dumper/; ## pass two anon hash refs to the sub Some_subroutine( { 'NAME' => 'name222', 'COLOR' => 'yellow', 'SIZE' => 'big', }, { 'NAME' => 'name444', 'COLOR' => 'yellow444', 'SIZE' => 'big444', }, ); sub Some_subroutine { ## collect the refs passed to the sub my @list = @_; ## just to see what we got print Dumper \@list; ## loop through each ref passed and process as before for my $ref (@list){ foreach my $key (keys %$ref) { print "key $key \tvalue is $ref->{$key}\n"; } } }