On Oct 10, 2005, at 21:21, Dan Klose wrote:

Hello list.

I have a hash of arrays but when I come to run the script I get the
following error:

Odd number of elements in hash assignment at ./all2seq.pl line 15.

I can't for the life of me work out why I am getting this error!
I have never hand written a HOA and so I have tried this:

my %properties = (
          "aliphatic" => qw[I L V],
          "aromatics" => qw[F Y W H],
          "phobic" => qw[I L V M C F Y W H K T G A],
          "charged" => qw[H K R E D],
          "polar" => qw[Y W H K R E D Q N S C T],
          "positive" => qw[R K H],
          "small" => qw[V P A G C S N D T],
          "tiny" => qw[G A C S],
);


Perl structures can store only scalars, use arrayrefs for the values instead of lists (and have a look at perldsc):

   my %properties = (
       aliphatic => [ qw(I L V) ],
       aromatics => [ qw(F Y W H) ],
       ...
   );

Remeber that => autoquotes a word to its left.

-- fxn



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to