in reply to Help creating/printing array of hashes

That is impressively complex for a "first perl program"!.

Others have directed you toward debugging (push a hashref into the array, instead of hash).

This note focuses more on perl STYLE - in particular, your use of c-style loops, which, although usable, are better written "perl style". Your loop:

for $i ( 1 .. $#allmolecules ) { ...
could be re-coded (untested) as:
for my $currentMolecule ( @allmolecules ) { ... while (my ($key,$val) = each %$currentMolecule ) { #line 222 if (ref($val) eq "ARRAY") { print "$key=@$val"; } else { print "$key=$val"; } ... } }
Note the use of "my" to localize the scope of temporary variables.
update: Changed inner "for" loop into a "while (my ($k,$v)=each.." loop after I noticed the O.P. needed both the key AND the value.

     Syntactic sugar causes cancer of the semicolon.        --Alan Perlis