in reply to Converting a HoH to an AoA

Use a hash slice. See perldata for more details.

my @rows; for my $name ( keys %ADDRESS ) { push @rows, [ "", @ADDRESS{ qw/ First Last Address Phone Email Description / } + ]; }

Update: D'oh. Yup, got distracted and used @ADDRESS{} instead of @{ $ADDRESS{$name } }{}. How embaraskin'.

Replies are listed 'Best First'.
Re^2: Converting a HoH to an AoA
by madbombX (Hermit) on Jan 19, 2007 at 19:53 UTC
    You were right on the money with the hash slice concept. Thanks. I just want to post the correct code since there was a slight error in yours:

    Instead of:

    push @rows, [ "", @ADDRESS{ qw/ First Last Address Phone Email Description / } ] +;

    I had to use:

    push @rows, [ "", @{$ADDRESS{$name}}{ qw/ First Last Address Phone Email Descrip +tion / } ];