Output nested array : Array Output « Array « Perl






Output nested array

   

#!/usr/bin/perl

use warnings;
use strict;

my @outer = (['a1', 'a2', 'a3'], ['b1', 'b2', 'b3'], ['c1', 'c2', 'c3']);

foreach my $outer_el (@outer) {
    foreach (@{$outer_el}) {
        print "$_\n";
    }
    print "\n";
}

   
    
    
  








Related examples in the same category

1.Output the whole array in print
2.Months Of The Year
3.A program that prints every element of an array.
4.Print each value in the array.
5.Output all elements in an array with print command
6.Output the last element in the array
7.Output the number of elements and the last index number
8.print "@{[uc(hello)]} there.\n";