Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: multidimensional array's

by 7stud (Deacon)
on Dec 27, 2012 at 21:10 UTC ( #1010577=note: print w/replies, xml ) Need Help??


in reply to multidimensional array's

use strict; use warnings; use 5.012; my $row1_ref = ['a', 'b', 'c']; my $row2_ref = ['xx', 'yy', 'zz']; my $data; push @$data, $row1_ref; push @$data, $row2_ref; use Data::Dumper; say Dumper($data); --output:-- $VAR1 = [ [ 'a', 'b', 'c' ], [ 'xx', 'yy', 'zz' ] ];
my( $author, $title, $results ) ; while ( my($lineno, $row_ref) = each @$data) { $author = $row_ref->[0]; $title = $row_ref->[1]; $results->[$lineno]->[1] = $row_ref->[2]; } say Dumper($results); --output:-- $VAR1 = [ [ undef, 'c' ], [ undef, 'zz' ] ];

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1010577]
help
Chatterbox?
LanX starts googling the punch line ...
[choroba]: suddenly, a weird noise can be heard, and the conductor stops them
[choroba]: (sorry, was interrupted by a call)
[choroba]: What was that? asks he
[choroba]: and the triangle player says, "That was me. It's written here in the score"
[choroba]: and shows a bar with a note "ohne Triangel"
[choroba]: where "ohne" means "will bend" in Czech
[LanX]: one-day-the- triangle-player-of -an-orchestra-gets -very-sick xD
[choroba]: :)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2017-03-27 11:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (319 votes). Check out past polls.