I am a newbee in perl. Just wanted some guidance so as to how to
implement multidimensional arrays in perl. I have to create an 2-d array
with 26*26 of all the english alphabets so that for each row and column i
can have a partiulcar value like a to a =1 b to a=2;
I am just not getting how to implelment this.

-------------------------
Something like this (using an array of hashes so the indexes can be letters)

use strict;

my $letter1 = "a"; my $i = 0;
while ($i<26) {
my $letter2 = "a"; my $j = 0;
   while ($j<26) {
$array{$letter1}{$letter2}=$j-$i; $letter2++;
       $j++;
   }
   $letter1++;
$i++; }

print "\n a,b = " . $array{a}{b};
print "\n b,a = " . $array{b}{a};
print "\n a,z = " . $array{a}{z};

Gives the output:
a,b = 1
b,a = -1
a,z = 25


jim
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to