in reply to Looping through multiple arrays

The first step: Fix the input. In your code sample, you created three arrays, each of them with just one member: an array reference.

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
    Sorry, its an array and not an array reference. Do you think this is legal?
    next if($array1|$array2|$array3) eq '';
    Seems to have solved the issue so far.