#!/perl -w
# NAME: arrays01.pl
# AIM: Just some tests with an Array of Arrays
# 04/09/2007 geoff mclane - http://geoffair.net/mperl/
use strict;
use warnings;
# declaring an array of arrays
my @AoA = (
        [ "fred", "barney" ],
        [ "george", "jane", "elroy" ],
        [ "homer", "marge", "bart" ],
      );
# add to an existing row
push( @{ $AoA[0] }, "wilma", "betty");
push( @{ $AoA[2] }, "peter", "paul");
# accessing printing the arrays
foreach my $aref ( @AoA ) {
     prt( "whole [ @$aref ],\n" );
	 prt( "1by1  [ ");
	 foreach my $k (@{$aref}) {
		 prt( "$k " );
	 }
	 prt("]\n");
}
exit(0);
sub prt {
	my ($m) = shift;
	print $m;
}
# eof - arrays01.pl
