SPUG: How to deal with same name packages?

Matt Tucker tuck at whistlingfish.net
Mon Jan 14 22:03:20 CST 2002

-- Colin Meyer <cmeyer at helvella.org> spake thusly:

> For edit, run, edit style coding (short scripts), the following is so
> convenient that I'll never give it up:
>   print STDERR "value: $value\n" if $DEBUG;
>   # actually I typically code a sub and just:
>   # debug("value: $value");

We've actually done something similar here but in a different
direction. All debug messages are written to a single debug object
which is shared across all modules. (When running anywhere but the dev
environment, writing to the debug object is essentially a no-op.) In
addition to holding debug messages, it also traps all STDERR output.
All messages are stored and then dumped out at the end of any html

I find it's a lot easier to actually see debug messages in the page
than to use a separate window which tails the error log. It also allows
for one to dump quite a bit more data without feeling overloaded, and
gives the added benefit of being able to easily search the output
(although one could presumably get the same by using less). Since the
output comes at the end of the page, it's reasonably unobtrusive. It
can also be turned off reasonably easily with a url parameter or a
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://mail.pm.org/archives/spug-list/attachments/20020114/311b65a6/attachment.bin

More information about the spug-list mailing list