SPUG: Debugging methodology (was: How to deal with same name packages?)
Tim Maher
tim at consultix-inc.com
Mon Jan 28 18:32:12 CST 2002
On Mon, Jan 28, 2002 at 03:08:23PM -0800, Colin Meyer wrote:
> On Mon, Jan 28, 2002 at 02:37:16PM -0800, Tim Maher wrote:
> >
> > > print STDERR "Debug/Assertion statement" if $debug > 1;
> >
> > BECOMES:
> > if ($debug > 1) { print STDERR "Debug statement" ; second_thing; }
> > OR even:
> > do { print STDERR "Debug statement" ; second_thing; } if $debug > 1;
>
> Or even:
>
> print (STDERR "Debug statement"), second_thing if $debug > 1;
That's just too kinky. I thought the whole idea of this backwards
statement was to make the code *easier* to read, not to make it
harder to see how much is being executed conditionally!
-Tim
>
> >
> > But, of course, TMTOWTDI! 8-}
>
> Have fun,
> -C.
--
*===========================================================================*
| Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# |
| EMAIL: tim at consultix-inc.com WEB: http://www.consultix-inc.com |
| TIM MAHER: UNIX/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl CGI/DBI |
| CLASSES! FEB: Unix; Perl; APR: Shell; Int & OO Perl; Perl Database w/DBI |
*===========================================================================*
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest
Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/
More information about the spug-list
mailing list