Re: HOA idiocy.
THIS is what I have this works I don really know if this is what you where looking for you can access elements such I did in the print statement it peints c use strict; use warnings; my %HOA = ( one = ['a','b','c'], two = ['c','z','s'], ); print $HOA{one}[2]\n; On 10/10/05, Dan Klose [EMAIL PROTECTED] 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], ); I have tried with and without the on the keys. This is probably something very trivial but I just can't work out what it is. If someone could make the pain go away that would be great. Thanks and apologies. Dan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
HOA idiocy.
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], ); I have tried with and without the on the keys. This is probably something very trivial but I just can't work out what it is. If someone could make the pain go away that would be great. Thanks and apologies. Dan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: HOA idiocy.
Everywhere you wrote aliphatic = qw[I L V], it should be something like aliphatic = [ qw(I L V) ], storing array refs at the hash, not arrays per se. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: HOA idiocy.
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