#!/usr/bin/perl -w use strict; $, = " "; my %Volume_Info = ( alpha => [ 0, 512, 1048576, 1, { one => 'first_hash' }, [ 'two', 'first_array' ], { three => 'second_hash' }, -1, 0, 0, 0, 0, 0, 'zfod', 0 ], beta => [ 1, 2, 3, { four => 'third_hash' }, 2, 1 ] ); for my $vol_key ( sort keys %Volume_Info ) { print "\nVolume: $vol_key\n"; foreach my $item ( @{ $Volume_Info{$vol_key}} ) { if (ref($item) =~ /ARRAY/) { print "Array in Array item: ", @{$item}, "\n"; } elsif (ref($item) =~ /HASH/) { print "Hash in Array: ", %{$item}, "\n"; } else { print "Array Item: $item \n"; } } }