Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How to store arrays in another array

by Bloodnok (Vicar)
on Oct 07, 2019 at 13:25 UTC ( #11107132=note: print w/replies, xml ) Need Help??


in reply to How to store arrays in another array

... or even more succinctly ...
my @rows = ( [ qw(71 22 15 10 51) ], [ qw(91 82 28 11 91) ], [ qw(11 72 37 58 20) ], [ qw(21 42 63 24 16) ], [ qw(81 32 53 54 42) ], );
or, if you really need to identify each array separately ...
my @row1 = qw(71 22 15 10 51); my @row2 = qw(91 82 28 11 91); my @row3 = qw(11 72 37 58 20); my @row4 = qw(21 42 63 24 16); my @row5 = qw(81 32 53 54 42); my @rows = ( \@row1, \@row2, \@row3, \@row4, \@row5 );
A user level that continues to overstate my experience :-))

Replies are listed 'Best First'.
Re^2: How to store arrays in another array
by AnomalousMonk (Bishop) on Oct 07, 2019 at 19:55 UTC

    my @rows = ( \@row1, \@row2, \@row3, \@row4, \@row5 );
    That's what
        my @rows = \(@row1, @row2, @row3, @row4, @row5);
    does.


    Give a man a fish:  <%-{-{-{-<

      Hmm, never knew that; TFT - just goes to show that my sig isn't in the least inaccurate

      A user level that continues to overstate my experience :-))

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2020-10-24 09:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (242 votes). Check out past polls.

    Notices?