$string =~ s/^\s+//; $string =~ s/\s+$//; #### @fi = split(/\s+/, $nextline); #### while(@fi[0] eq'') { $nextline = readline; //remove whitespace //split the line, but I think I included my accidentally so that I had my @fi = split..... }