Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Monks, hi there!
I followed a node here while ago and one part of the code got me going, I wish someone could show me a better way to accomplish this issue, I can't figure it out. Is got to be a better and simpler way to do this.
It needs to place a space in the $ref_b to make sure consistency when generating a report out of this and avoid errors.
I followed a node here while ago and one part of the code got me going, I wish someone could show me a better way to accomplish this issue, I can't figure it out. Is got to be a better and simpler way to do this.
It needs to place a space in the $ref_b to make sure consistency when generating a report out of this and avoid errors.
use strict; use warnings; use Data::Dumper; my $ref_a = [ [ qw/a b c/ ], [ qw/d e f/ ], [ qw/g h i/ ], [ qw/x y z/ ], [ qw/3 4 5/ ], [ qw/6 7 9/ ], ]; my $ref_b = [ [ qw/j k l/ ], [ qw/m n o/ ], [ qw/p q r/ ], ]; for my $i (0..$#$ref_a) { push @{$ref_a->[$i]}, @{$ref_b->[$i]}; } print Dumper($ref_a);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Undefined Array Reference
by Nkuvu (Priest) on Apr 22, 2009 at 23:40 UTC | |
by Anonymous Monk on Apr 23, 2009 at 03:50 UTC | |
by lostjimmy (Chaplain) on Apr 23, 2009 at 13:02 UTC | |
by Anonymous Monk on Apr 23, 2009 at 14:43 UTC | |
by NateTut (Deacon) on Apr 24, 2009 at 18:58 UTC | |
Re: Undefined Array Reference
by almut (Canon) on Apr 22, 2009 at 23:58 UTC | |
by wol (Hermit) on Apr 23, 2009 at 16:05 UTC | |
Re: Undefined Array Reference
by syphilis (Archbishop) on Apr 22, 2009 at 23:42 UTC | |
by ikegami (Patriarch) on Apr 22, 2009 at 23:54 UTC | |
Re: Undefined Array Reference
by lostjimmy (Chaplain) on Apr 23, 2009 at 13:00 UTC | |
Re: Undefined Array Reference
by bichonfrise74 (Vicar) on Apr 23, 2009 at 01:27 UTC | |
Re: Undefined Array Reference
by Marshall (Canon) on Apr 25, 2009 at 11:05 UTC |
Back to
Seekers of Perl Wisdom