Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Re: Streaming to Handles

by dave_the_m (Parson)
on May 01, 2004 at 13:33 UTC ( #349606=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Streaming to Handles
in thread Streaming to Handles

The only way I can think of doing this without heavily restructuring your code is to create a pipe, fork off a child, then have the child write the list of filenames to the pipe and have the parent read them back in.


Comment on Re: Re: Re: Streaming to Handles
Re: Re: Re: Re: Streaming to Handles
by sgifford (Prior) on May 01, 2004 at 16:21 UTC
    ...Which isn't as hard as it sounds. Something like:
    my $f = List->new; my $pid = open(FROM_LIST,"-"); if (!defined($pid)) { die "fork error: $!\n"; } elsif (!$pid) { # Child $f->stream_to(\*STDOUT); $f->look_in('c:/'); $f->list; exit(0); } # Parent while (<FROM_LIST>) { print "$_\n"; }
    should do the trick.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2014-11-22 17:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (123 votes), past polls