in reply to using warn instead or print STDERR?
Thanks for asking such an interesting question. I learned from the responses.
This is barely not offtopic, or something. I'd like to make a suggestion and ask a question.
IMO, these kind of debugging output lines are a perfect place to use the dreaded postfix if. I find:
to be clearer than:warn "Watch out, there a llamas!\n" if $DEBUG;
$DEBUG and warn "Watch out, there a llamas!\n";
I guess its becuase the short circuit in the 'and' is not part of the meaning of the English word. The use or for things like open(...) or die "Ugh." doesn't bother me, because the sense is the same in English as in Perl.
Is there a particular reason you like to use the $DEBUG and ... form?
TGI says moo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: using warn instead or print STDERR?
by leocharre (Priest) on Feb 27, 2009 at 21:01 UTC | |
|
Re^2: using warn instead or print STDERR?
by rhesa (Vicar) on Feb 27, 2009 at 00:27 UTC |