in reply to Keep Those Conditionals Tight

Situations like that have gotten me started down the road of testing defined-ness or existence, never truth (except for something that specifically is supposed to be a boolean, usually because it begins with $is_).

It's also kinda like the C-programmer's idiom of if ( 5 == var ) instead of if ( var == 5 ). That protects against the accidental if ( var = 5 ).


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^2: Keep Those Conditionals Tight
by xdg (Monsignor) on Mar 10, 2006 at 15:05 UTC

    (Nods). Makes me wish there was a def as short as ref.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.