#!/usr/local/bin/perl -w use strict; my @array = (); sub foobar() { $array[0] = { id => 1, status => 0, loc => 'awx1' }; $array[1] = { id => 2, status => 1, loc => 'xxx1' }; } sub fubar(%) { my (%myhash) = @_; printf "Thread <%d>, status <%d>, location <%s>\n", $myhash{id}, $myhash{status}, $myhash{loc}; } foobar(); my $nbr = 0; foreach (@array) { fubar(\$array[$nbr]); } print "Printing the array ...\n";