Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Filter::Handle

by Adam (Vicar)
on Sep 09, 2000 at 01:51 UTC ( [id://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.

Replies are listed 'Best First'.
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.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-12-02 17:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found