in reply to Combining two references

jeffa's proposal is probably the simplest, but your code would work if you change the relevant line to:
push @{ $all }, @$data1, @$data2;
When I dump $all after this change, I get:
$VAR1 = [ { 'NAME' => 'PAUL DY', 'DATE' => '2009-05-05', 'NUMBER' => '00001' }, { 'NAME' => 'ANTHONY RD', 'DATE' => '2012-01-07', 'NUMBER' => '00003' }, { 'CAR2' => '2', 'CAR1' => '1', 'CAR3' => '3' }, { 'CAR2' => '2b', 'CAR1' => '1b', 'CAR3' => '3b' } ];
i.e. presumably what you want.

Replies are listed 'Best First'.
Re^2: Combining two references
by Anonymous Monk on Jun 08, 2015 at 18:06 UTC
    This did, is that a way to avoid printing "undef"s:
    my $all; push @{ $all }, @$data1, @$data2; foreach my $row (@$all) { my $name = $row->{ NAME }; my $date = $row->{ DATE }; my $number = $row->{ NUMBER }; my $car1 = $row->{ CAR1 }; my $car2 = $row->{ CAR2 }; my $car3 = $row->{ CAR3 }; warn Dumper $name,$date,$number,$car1,$car2,$car3; }

    Thanks!
        We can use the columns names from here:

        name - date - number - car1 - car2 - car3

        DB will be MS SQLServer

        Thanks!
        OK, read that, the idea here is to have each row inserted in a db table.