in reply to Coerce array into hash problem

If $AoH is an array of hashes, then your line should be my $year = $AoH[ data ]->{ 'YEAR' } || '';

As it is now, it tries to coerce the array $AoH into a hash, and fails.

Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."

Replies are listed 'Best First'.
Re^2: Coerce array into hash problem
by graff (Chancellor) on Oct 04, 2008 at 05:22 UTC
    Um, wouldn't there be a problem using a bare word ("data") as an array index?

    With use strict;, such a thing would not be allowed; without the stricture, the bare word evaluates to zero when interpreted in a numeric context, and this is probably not the real intention...