in reply to Regex condition

It looks like you want to be using split, maybe like:
my @fields = split /\t/, $_;

Replies are listed 'Best First'.
Re^2: Regex condition
by ikegami (Patriarch) on Oct 23, 2007 at 15:26 UTC

    You forgot to remove the trailing newline. (Note the \n in the OP's regex.)

    chomp; my @fields = split /\t/, $_;

    And if you want to keep empty trailing fields, you'll need to specify the third parameter.

    chomp; my @fields = split /\t/, $_, -1;