sub subgen { my $aref = @_; my($cur_segno) = 0; my(@sst) = (); open(FILE, $aref); #or die "Cannot open: $file\n"; my $hdr = ; #read in the first line chomp $hdr; my @colnames = split /, ?/, $hdr; #split the header into an array open GENFILE, '>genfile.txt'; open INFOFILE, '>infofile.txt'; my $sst_mean; my %fronts; while () {