in reply to Problems With Tab Delimited Files

It would help if each file was a separate code block. It would help even more if you had been able to narrow down the problem some first. And obviously, the total lack of indentation is an assault on our eyes.

Fortunately, I happen to spot the problem while glancing at the code. The following code loops until the array is empty (i.e. the first remaining element is undef) or until the first remaining element of the array is false (zero is false):

while ($pyclinevalues[0]) { $pyc = $pyclinevalues[0]; ... shift(@pyclinevalues); }

You should be looping while the number of elements in the array is non-zero, or true:

while (@pyclinevalues) { $pyc = $pyclinevalues[0]; ... shift(@pyclinevalues); }

But why use a while loop at all?

for my $pyc (@pyclinevalues) { ... }

By the way, Text::CSV handles tab-separated files without problem.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.