Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: N-Dimensional Arrays on the fly

by Zaxo (Archbishop)
on Aug 20, 2004 at 01:45 UTC ( [id://384518]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @array = (undef) x $size[0];
    $_ = [ map { [(0) x $size[2]] } (undef) x $size[1] ] for @array;
    
  2. or download this
    $array[$foo][$bar][$baz] = $quux
        if $foo >= -$size[0] and $foo < $size[0]
            and $bar >= -$size[1] and $bar < $size[1]
            and $baz >= -$size[2] and $baz < $size[2];
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://384518]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-03-28 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found