[Chicago-talk] DEBUG function

Jay Strauss me at heyjay.com
Mon Mar 1 19:44:10 CST 2004


Thanks, I look at the module.

jay
----- Original Message ----- 
From: "Greg Fast" <gdf at speakeasy.net>
To: "Chicago.pm chatter" <chicago-talk at mail.pm.org>
Sent: Monday, March 01, 2004 10:46 AM
Subject: Re: [Chicago-talk] DEBUG function


> Another trick: put this DEBUG.pm (listed below) somewhere in your
> @INC.  Comment out any debugging-only lines by starting them with 
> "#DEBUG " (with trailing space), which will cause perl to compile them
> away entirely.  When you need the debugging lines, add a "use DEBUG;" to
> your file (or -MDEBUG on the cmdline) to magically uncomment them.
> 
> --start DEBUG.pm
> 
> package DEBUG;
> 
> =pod
> 
> =head1 SYNOPSIS
> 
>     use DEBUG;
>     #DEBUG print complex_debugging_output($_) for @huge_data_structure;
> 
> =head1 DESCRIPTION
> 
> Uncomments lines beginning with "#DEBUG " when used.
> 
> =cut
> 
> use Filter::Simple;
> 
> FILTER {
>   s/^\s*\#DEBUG //gm;
> }
> 
> 1;
> 
> --end DEBUG.pm
> 
> --
> Greg Fast
> http://cken.chi.groogroo.com/~gdf/
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at mail.pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
> 
> 




More information about the Chicago-talk mailing list