in reply to Re^2: Uninitialized Value
in thread Uninitialized Value

Just add after 'chomp;':
next unless length;

Replies are listed 'Best First'.
Re^4: Uninitialized Value
by Athanasius (Archbishop) on May 18, 2015 at 17:27 UTC

    That’s a good way to bypass blank lines, but it won’t bypass a line containing only spaces, or a line containing “word” characters and/or digits but no colons. In both these cases, there is nothing to split on, so $field[1] is undefined. Rather than trying to test the line to predict whether $field[1] will be defined, a simpler and safer approach is to test for the condition causing the warnings directly:

    next unless defined $field[1];

    Hope that helps,

    Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

      I've added that code as well...thanks!