http://qs321.pair.com?node_id=75693


in reply to Getting information from an array of hashes

Data::Dumper showed me the way. What I had was not an "array of hashes". It was, as far as I can tell, an array containing one element, and that element was an array, containing the hashes.

I finally figured it out when I tried this on a hunch:

print "${${$diary_data[0]}[0]}{user}\n"; print "${${$diary_data[0]}[0]}{timestamp}\n"; print "${${$diary_data[0]}[0]}{value}\n";

which gave me some good output:

MAWEBB 988227105 NSA NOTIFY NETWORK MAINTENANCE 4/24/01 + 22:05 CST

From there, I was able to come up with:

$i=0; while (${${$diary_data[0]}[$i]}{user}) { print "User:\t\t${${$diary_data[0]}[$i]}{user}\n"; print "Timestamp:\t${${$diary_data[0]}[$i]}{timestamp}\n"; print "Information:\t${${$diary_data[0]}[$i]}{value}\n\n"; $i++; }

This gives me exactly the information I'm looking for. All that's left is munging it into a decent format for e-mail.

There are still some things I need to do with cleaning up this code, and I need to go back over exactly why this works the way it does, but I think I'm on the right track here. Thanks again Monks for the help today! :-)

Chumley