how to create a two-dimensional array? Posted by yfpeng
(yfpeng), 17 September 2002As I promised I will ask you more
questions. I guess we can use two-dimensional arrays in perl - I
saw some examples but their elements are all hard-coded. I want
to create an empty two-dimensional array first, then push
elements into this array. The elements are paired, e.g. if I
push an T into the first array (in the two-dimensional array),
then it will push A into the same position of the second array,
so the 2-D array looks like: TTGC... --the first array AACG...
--the second array It is like a matrix. how to do this in perl.
thanks very much. Posted by admin (Graham Ellis), 17 September
2002Perl uses "lists" rather than arrays - they can do
everything an array can go in other languages (except give you
problems when you run off the end), and lots more things besides
... Amazingly, you don't have to tell Perl what's a list of
lists (oh - sorry - that's what a "2 dimensional array" should
be called). It works it out for itse