print "START: Interface report on $hostname\n"; for(my $i = 0; $i <= $#dat; $i++){ # $#dat gives the highest index from the array for(my $j = 0; $j <= $#dat ; $j++){ print "$dat[$i][$j] "; } print "\n"; } print "END: Interface report on $hostname\n";