#!/usr/bin/perl use warnings; use strict; my @array; foreach my $outer ( 0 .. 3 ) { foreach my $inner ( 0 .. 3 ) { $array[ $outer ][ $inner ] = $outer * $inner; } } foreach ( 0 .. $#array ) { $array[ $_ ]->[ 4 ] = $_ * 4; } print( "@array\n" );