Is there an easy way to pipe output to an external perl routine and then
pipe the output of that routine back in for more processing?

In particular I want to use LWP::UserAgent to grab a web page, pipe the
output to Tom Christiansen's "striphtml" routine
(http://www.cpan.org/authors/Tom_Christiansen/scripts/striphtml.gz) and then
pipe that output back in for some subsequent processing.  Something like:

my $ua = new LWP::UserAgent;
my $request = new HTTP::Request('GET', $myURL);
my $response = $ua->request($request);
my $page = $response->content;

open(STRIPHTML, "|striphtml.pl") || die("Can\'t open striphtml: $!\n");
print STRIPHTML $page;
close(STRIPHTML); # maybe not such a good idea?

This works fine so far... But now what?  How do I get the output of
striphtml.pl back in to do some more processing on it?

I know I can do this with a temporary file, but I loathe using them when
reasonable alternatives might be available...

Thanks!
-Dan

---
Dan Fish - [EMAIL PROTECTED] 
"A -good- dive buddy will be there if you run out of air, a -great- one will
be there before you run out!"


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to