in reply to Tab delimited code problem?

Your code groups multiple tabs together because you told it to. /\t+/ says to use 1 or more tabs to split on. If you want to split on a single tab, then use a single tab: /\t/. Also note, that by default, trailing empty fields are discarded. You can avoid this by using the 3 argument version of split.

Also, when you have multiple scalars named something like $foo1, $foo2, $foo3, etc, that is usually a sign that you want an array. Something like:

@values = split /\t/, $line, -1;

Replies are listed 'Best First'.
Re^2: Tab delimited code problem?
by Aristotle (Chancellor) on Jan 25, 2003 at 23:40 UTC
    This is a point that deserves more than the cursory mention it got: passing -1 as the number of desired fields to split is important when dealing with the possibility of empty fields. If you don't pass a number of desired fields, and the last fields in the input string are empty, then split will drop them from the output. This is desirable in some cases, but not so in others. At any rate, one should be aware of this.

    Makeshifts last the longest.