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

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.

  • Comment on Re^3: Location of Conditional test effects results

Replies are listed 'Best First'.
Re^4: Location of Conditional test effects results
by chakram88 (Pilgrim) on Apr 11, 2007 at 01:16 UTC
    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.