Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Filter::Handle

by Adam (Vicar)
on Sep 09, 2000 at 01:51 UTC ( #31691=modulereview: print w/ replies, xml ) Need Help??

Item Description: Apply a filter to a filehandle! Written by our own btrott

Review Synopsis:

Filter::Handle

This module was originally written here at the Perl Monks Monastery. It provides a simple interface allowing users to tie a filter subroutine to a filehandle. There are many things you could do with this... from labeling STDERR output as STDERR output to easily puting line numbers and timestamps in a logfile.

Comment on Filter::Handle
RE: Filter::Handle
by mirod (Canon) on Sep 11, 2000 at 21:26 UTC

    I have just one question: how does this compare to using a magic open?

    A magic open is a really cool Perl feature that let you... set a filter on a file! Just like this:

    #!/bin/perl -w use strict; set_filter(); # sets the post-processing filter print "main processing is here\n"; print "and continues here\n"; exit; BEGIN { my $i=1; sub set_filter { return if my $pid= open( STDOUT, "|-"); # magic open die "cannot fork: $!" unless defined $pid; while( <STDIN>) { printf "line %03d: %s", $i++, $_; } exit; } }
Re: Filter::Handle
by Aristotle (Chancellor) on May 23, 2002 at 10:01 UTC
    It would have been nice if the review actually was one.. :-/
    ____________

    Makeshifts last the longest.

Back to Reviews

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: modulereview [id://31691]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (13)
As of 2014-09-19 09:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (133 votes), past polls