Click here to get back home

output-monitoring module

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
output-monitoring module Henry Townsend 04-06-2005
Posted by Henry Townsend on April 6, 2005, 11:38 am
Please log in for more thread options


Please forgive me for asking here, I have done some searches and come up
empty but I still think this module may have been written and want to
know for sure before I go trying to roll my own.

I'm thinking of writing a module which would monitor the output of any
script which "use"d it looking for errors. E.g. something like this

use Output::Monitor STDOUT => qr/re1/, STDERR => qr/re2/;

This would - perhaps by using tied filehandles - watch all data flowing
to stdout and stderr, apply the specified REs to each line, and convert
the exit status to nonzero if any matches occur.

The idea is to replace a common technique where I work, which is to
write build scripts to divert their own output to a logfile internally,
then read that logfile to discover any unflagged errors. This makes it
hard for external tools to redirect output as they choose, requires
intimate knowledge of the script to know where it's writing its logfile
to, etc. What I'd hope to achieve with the above is transparency, i.e.
by simply including the module within a script it would be converted
from unchecked to checked, without the script having to change anything
else while the same data as before flows to stdout and stderr.

Before anyone says "just check exit status" - we do but we're stuck with
certain underlying build tools which have unreliable status so we must
parse output as a belt-and-suspenders plan.

Does anyone know of such a module, or something close to use as a
starting point?

--
Henry Townsend


Similar ThreadsPosted
Lower case module name for non-pragma module January 4, 2005, 10:19 am
RFC: New module 'Module::Bundled::Files' August 26, 2005, 3:49 pm
help with an MD5.pm module!! September 3, 2005, 11:39 pm
Looking for RTP module December 9, 2004, 9:17 pm
module for FFT May 9, 2005, 3:06 pm
Module may not be right one? April 27, 2006, 12:57 pm
The 'if' module June 1, 2006, 8:18 pm
The 'if' module June 1, 2006, 8:26 pm
use module March 3, 2007, 5:13 am
Name my Module! July 27, 2007, 6:46 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap