in reply to Looping through multiple arrays
Square brackets introduce array references. Use round parentheses () for lists.
@array1 = ('a','b','c'); @array2 = ('a','b'); @array3 = ('a','b','c','d');
How do you want to group the results?
#! /usr/bin/perl use warnings; use strict; use Syntax::Construct qw{ // }; my @array1 = ('a','b','c'); my @array2 = ('a','b'); my @array3 = ('a','b','c','d'); while (@array1, @array2, @array3) { print join ', ', map shift @$_ // 'NULL', \@array1, \@array2, \@ar +ray3; print "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Looping through multiple arrays
by Anonymous Monk on Mar 05, 2015 at 12:12 UTC |