in reply to Re: Creating an array of structures?
in thread Creating an array of structures?

my %foo = ( name1, type1; name2, type2; name3, type3; name4, type4 ); print $foo{name2}, "\n";

I realize that's probably just pseudo-code, but we ought to get the syntax right anyway. :)

my %foo = ( name1 => 'type1', name2 => 'type2', name3 => 'type3', name4 => 'type4' ); print $foo{name2}, "\n";

In particular, note the use of ',' (comma) instead of ';' (semicolon) between list items.


Dave