# $hFORM is a hash reference my $hFORM = parseCGIStream(\*STDIN); # input is stored as key-value pairs in $hFORM # output is all these variables my ($aMpe, $aMpy, $aGrand, $aPopbyyer , $total, $gener) = datafilla($hFORM); # input is $gener, $total # output is $aOa (array reference storing your @aoa) my $aOa = popfilea($gener, $total); #... and so on ...