#!/perl/bin/perl.exe -w use strict; use vars qw(@array @data @compare $num ); $num = 0; for (0 .. 3) { @array = (); for (0 .. 1) { push @array, $num; $num ++; } push @data, [@array]; } @compare = (2, 4, 5, 6); print "Contents of \@array\n"; foreach my $record (@data) { for my $i (0 .. 1) { print $record->[$i] . " "; } print "\n"; } print "\n\nContents of \@compare\n"; foreach (@compare) { print $_, " "; } #### Contents of @array 0 1 2 3 6 7 Contents of @compare 2 4 5 6