in reply to "Use of uninitialized value" due to empty elements in an array

The defined function is what you need. It returns true if the value being tested IS NOT the special undef value. So something like:

unless (defined($line_split[0])) {...} ...

ahead of your other tests should get the job done.

Update: Fixed typo..

Good luck. -c