Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

RE: Filter::Handle

by mirod (Canon)
on Sep 11, 2000 at 21:26 UTC ( #31935=note: print w/replies, xml ) Need Help??

in reply to Filter::Handle

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; } }

Replies are listed 'Best First'.
RE: RE: Filter::Handle
by merlyn (Sage) on Sep 11, 2000 at 21:31 UTC

Log In?

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

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

    Results (14 votes). Check out past polls.