Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Preprocessing print statements

by salva (Canon)
on Nov 12, 2020 at 09:27 UTC ( #11123603=note: print w/replies, xml ) Need Help??


in reply to Preprocessing print statements

You can fork a new process for doing the filtering in parallel:
use POSIX; ... my $pid = open(STDOUT, "|-") // die "unable to fork new process"; unless ($pid) { while (<>) { print if /the-regular-expression-goes-here/ } POSIX::_exit(0); } # after this point, STDOUT is filtered

Update: That works in Unix/Linux systems. I am not sure about Windows, but probably not!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2022-01-29 08:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (74 votes). Check out past polls.

    Notices?