in reply to Argument "" Isn't numeric in numeric eq (==)

I think this is a good example where you can locally switch off warnings. You can of course also add tests that check (with eq rather than ==) if any field is blank, but that only complicates the logic for no good reason.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Replies are listed 'Best First'.
Re^2: Argument "" Isn't numeric in numeric eq (==)
by ler224 (Acolyte) on Feb 09, 2014 at 15:35 UTC
    Yes I tried using eq, but the logic was getting too complex.

      But did you try simply switching off warnings (in a suitably narrow scope, of course)? I.e.,
          no warnings;
      or
          no warnings qw(numeric);

      See warnings and perllexwarn.