On Wed, 2002-09-18 at 09:56, pravesh biyaNI wrote:
> Hi
>   I am using a two dimentional array!! but the script on running gives 
> an error
> 
> global symbol requires explicit package name.
> 
> how to use my () with a two dimentional array
> 
> help awaited
> pravesh

First you must recognize that there is no such thing as a
multidimensional array.  It is really an array that holds arrayrefs as
values.  When you successfully wrap your head around that concept you
will see that there is no difference between "normal" arrays and
multidimensional arrays.  

<example>
#!/usr/bin/perl

use strict;

my @LoL = (
        [ 1, 0, 0 ],
        [ 0, 0, 1 ]
);

for my $x (0..$#LoL) {
        for my $y (0..$#{$LoL[$x]}) {
                print "$LoL[$x][$y] ";
        }
        print "\n";
}
</example>


 
-- 
Today is Sweetmorn the 42nd day of Bureaucracy in the YOLD 3168
Grudnuk demand sustenance!

Missile Address: 33:48:3.521N  84:23:34.786W


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to