in reply to Re: Location of Conditional test effects results
in thread Location of Conditional test effects results

Ding!Ding!Ding! We have a winner! And thanks to ferreira's great explanation above, I now have lots of reading to do too.
  • Comment on Re^2: Location of Conditional test effects results

Replies are listed 'Best First'.
Re^3: Location of Conditional test effects results
by ikegami (Patriarch) on Apr 10, 2007 at 21:43 UTC

    Yes, I know that the eq test is putting up 'undefined' warnings on those $records where the secondary array is not defined. I deal with it in my full code,

    Had you fixed them, you would have fixed your problem too. Do not lightly ignore warnings in Perl.

      The problem I had was not understanding why the results changed when I moved the order of tests.

      I learned something from the other responses.

      I can modify the presented code to read

      $editor = "no editor" if $record->{'services'}[0]{'class'} && $rec +ord->{'services'}[0]{'class'} eq 'Primary';

      The warnings go away, but the odd results still are present. I don't lightly ignore warnings in Perl; in this instance I knew that the warning were not pointing to the problem.

      As I said, the warnings are not present in my full code, but I was narrowing down the code to smallest snippet possible to reproduce the error.

      Interestingly, I often am able to solve many questions I have by doing just such an exercise. Many times I've thought to seek the wisdom of the monks, only to figure out the answer while minimizing my code. I'm sure I'm not the only one.