in reply to printing hashes with multiple values

In case you need an example, this snippet shows the basics, you can easily test for

if (ref $_ eq 'ARRAY')

#!/usr/bin/perl %CARD_DATA = ( CARDS => { AX => { name => "American Express", valid_card => "true", fee_code => "1", currency => {US=>'1',CA=>'2',GB=>'3'}, misc_data => [], }, DI => { name => "Diners Club", valid_card => "false", fee_code => "", currency => {US=>'1',CA=>'2',GB=>'3'}, misc_data => ["CVV=4"], }, DS => { name => "Discover", valid_card => "false", fee_code => "", currency => {US=>'1',CA=>'2',GB=>'3'}, misc_data => [], } } ); my $depth = 0; print_keys( \%CARD_DATA ); sub print_keys { my $href = shift; $depth++; foreach ( keys %$href ) { print ' ' x $depth, "--$_\n"; print_keys( $href->{$_} ) if ref $href->{$_} eq 'HASH'; } $depth--; }