in reply to Re^2: hashref to arrayref
in thread hashref to arrayref

I'm not clear on what you want the array to contain. Just the bottom-level values? If I understand correctly, your structure looks like
%errors=(key1 => { date => 'some date', time => 'some time', }, key2 => { date => 'some other date', time => 'some other time', }, ... );
so when you read it in list context, you get a list of keys and hashrefs. What exactly are you trying to get back?

Replies are listed 'Best First'.
Re^4: hashref to arrayref
by mcarthey (Novice) on Jul 31, 2009 at 17:46 UTC
    I ended up doing the following to get what I needed:
    my @values = map { ( $errors{$_}{'date'}, $errors{$_}{'time'}, $errors{$_}{'cnt' +}, $_ ) } keys %errors; my $value_ref = [@values]; my $file_ref = new IO::File "> csvoutput.csv"; my $status = $csv->print ($file_ref, $value_ref)
    The problem was that in my original code I was returning array references to the elements in the @values array. I simply had to remove the brackets and all is good. Thanks again for all your time!