note
kcott
<p>G'day [RedTussock],</p>
<p>Welcome to the monastery.</p>
<p>
I'm reasonably certain that your problem is in <c>map qq/"$_"/, @fields[ 0 .. 5 ]</c> and is probably caused by <c>@fields</c> not containing 6 elements. Here's some troubleshooting hints.
</p>
<p>
Check the files you're reading (i.e. <c>ls -l /home/Smitty/scripts/perl/dl_parser/down/*</c>). Are all of these the files you want? Perhaps use <c>*.txt</c> (or similar) to limit the files you're processing.
</p>
<p>
Do all of the files have the format you're expecting? You may be able to check this by inspection. If not, add some debugging code around <c>while (<>) {</c> like this:
</p>
<code>
my $last_file = '';
while (<>) {
print "$ARGV\n" if $ARGV ne $last_file;
$last_file = $ARGV;
</code>
<p><em>
[[http://perldoc.perl.org/perlop.html#I%2fO-Operators|perlop - I/O Operators] explains <c><></c> and <c>$ARGV</c>]
</em></p>
<p>
You should see something like:
</p>
<code>
some_file_name
another_file_name
Use of uninitialized value in ...
different_file_name
Use of uninitialized value in ...
</code>
<p>
You'll now know which files are causing the problems and you can focus your investigation accordingly.
</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-861371">
<p>-- Ken</p>
</div></div>
997645
997659