siskos1 has asked for the wisdom of the Perl Monks concerning the following question:
so my question is, how can i use strings in an array bracket. like $array [ proteinA ] [ proteinB ] if i am not wrong, it is possible without using "strict". code will be used just a couple of times, so easier way is better. i would also like to hear, if there are some other ways. thanks for reading.$/ = undef; my $string = <IN>; my @all = split /\t|\n/,$string; my @array; for ($i=0; $i<$#all; $i+=2) { $array[$all[$i]] [$all[$i+1]] = 1 ; $array[$all[$i+1]] [$all[$i]] = 1 ; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how can i use characters in 2 dimensional array brackects
by BrowserUk (Patriarch) on Jun 13, 2010 at 10:31 UTC | |
|
Re: how can i use characters in 2 dimensional array brackects
by Corion (Patriarch) on Jun 13, 2010 at 09:16 UTC |