SPUG: Last night's meeting

Brian Hatch bri at ifokr.org
Wed Mar 17 14:32:27 CST 2004



> I enjoyed the demo, and was reminded that there are some things that
> are better done using perl -d than by print statements.
> 
> > Condemn all debug print statements now!
> 
> IMHO, the humble print statement has a significant advantage over
> any interactive-debugging based strategy, which is simply that it
> will still be there if/when the program breaks again, and it can
> easily be re-activated to deliver its benefits again.


I totally agree with Tim here - debugging print statements are great:

	GetOptions(
		...
		"debug" => \$DEBUG,
		...
	);


	...

	print STDERR "random annoying debug statement\n" if $DEBUG;

Just slap those 'if $DEBUG' tags on as needed.  Or to save typing

	$DEBUG && print STDERR "random annoying debug statement\n";

Also has the benifit of making it obvious as you scan the left hand side
of the script that you need not read this line.


--
Brian Hatch                  Two wrongs are
   Systems and                only the beginning.
   Security Engineer
http://www.ifokr.org/bri/

Every message PGP signed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.pm.org/pipermail/spug-list/attachments/20040317/e954ce2e/attachment.bin


More information about the spug-list mailing list