Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic


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:


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?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (1)
As of 2023-06-07 03:26 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (29 votes). Check out past polls.