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.
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);
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|