hi. i havent been learning perl for a while and i forgot a lot. so it may be easy question, sorry for that.
my problem is, i am creating a 8000x8000 2 dimensional array. there are some proteins, if they interact, their corresponding value will be 1, otherwise 0.
interacting proteins are given pairwise in a tab delimited text row by row. so i have thought of something like this;
$/ = 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 ;
}
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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.