in reply to array of hashes question

But second for loop doing it does not produce any output

I don't see where you output anything.

I also don't know the format of the data structure, so there's no way to know if any of what you are doing makes sense. I mean, it looks plausible, but you're saying there's some problem. Please specify what the problem is, and show us your data structure (using Data::Dumper and print(Dumper(\@a));, and/or by showing create_hash_for_filename).


Some side notes:

my %b; create_hash_for_filename($filename,\%b); push @a, {%b};

It would make more sense if create_hash_for_filename returned a hash ref.

sub create_hash_for_filename { my %b; ... return \%b; } push @a, create_hash_for_filename($filename);

for (my $i=0;$i<10;$i++)

How about

for my $i (0..9)

Replies are listed 'Best First'.
Re^2: array of hashes question
by jimmy78 (Initiate) on Feb 18, 2009 at 16:38 UTC
    now added the print for loop for first hash