sub parsefiletypeX { my $filename = shift; #get the directory from the filename(w/ directory) open(IN, $filename) or die... open(OUT, $outfile) or die... my $lineCount = 1; my $nextline = ; my $headerlines; my $samplesize = 1; my @array; $nextline = trim_whitespace($nextline);#my subroutine ++$LineCount; #Did this before I learned about $. #read the header for the file(five lines) #Do a bunch of regex checks on the header lines #Read in the first record, which contains its own line of sub header data as well as the two lines of actual data in pascal float format I believe. Or fortran actually. #Regex on the first line and push a certain piece of data. This line is NOT the bad line push( @array, @fi[4]);#1st line has 5 values #Regex checks on the next two lines #Then read in the rest of the 3-lined records until(eof(IN)) { #get the same three lines and do the regex checks #now the faulty call is made push( @array, @fi[4]); } //Do stuff to the @array, like sorting and determining certain checks. close IN; close OUT; #call function that uploads a record to the database.