in reply to parsing text file

hi

Assuming that

  1. $line is a line you've read from your text file, and that
  2. a newline is your record delimiter, and that
  3. your fields' content never contains tabs:
$line =~ s/\t+/\t/g;

The + modifier to the \t tells the regular expression to find one or more of the preceding thingie (in this case, a tab). The g modifier at the end tells the regular expression to perform the substitution on all occurrences of the match.

HTH

//=\\