#!/usr/bin/perl ################################################################################## use strict; #use warnings; use Tie::File; popfileb(); print qq{DONE!!\n} or die 'unable to print to screen'; my @aod=(); my @aox=(); tie @aod, 'Tie::File', 'tmp/test.txt', recsep => "\n"; sub popfileb { foreach my $yb ( 0 .. 10 ) { foreach my $xb ( 0 .. 10 ) { #set first row; if ( $yb == 0 ) { substr $aox[0], $xb, 1, 'n'; } #set increasing rows; elsif ( $yb > 0 ) { substr $aox[$yb], $xb, 1, 'a'; } } $aod[$yb] = qq{$aox[$yb]\n}; } return; } untie @aod; exit;