Click here to get back home

recursive perl?

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
recursive perl? bukzor 06-04-2008
`--> Re: recursive perl? Martijn Lievaar...06-06-2008
Get Chitika Premium
Posted by bukzor on June 4, 2008, 11:00 pm
Please log in for more thread options
Here's what I'd like to do (unwise as it is) in a perl script:

1. pipe a perl script into a perl subprocess and capture the output
into a file (easy)
2. change the output of the perl subprocess to another file (also
easy: just pipe in an open(STDOUT, ">$file"))
3. Take the output of #1 and pipe that into the perl subprocess.

The problem is that perl waits for an end-of-file before starting
execution, so the output of #1 is not ready by the time I get to #3.
The main point of this is to preserve all the variables in perl's
memory on the second pass, so closing perl is not an option.

Is there a way to force perl to start executing before it gets to EOF?
I guesss I'm basically asking for an interactive mode...

Thanks!
--Buck

Posted by Martijn Lievaart on June 6, 2008, 3:13 am
Please log in for more thread options
On Wed, 04 Jun 2008 20:00:02 -0700, bukzor wrote:

> Here's what I'd like to do (unwise as it is) in a perl script:
>
> 1. pipe a perl script into a perl subprocess and capture the output into
> a file (easy)
> 2. change the output of the perl subprocess to another file (also easy:
> just pipe in an open(STDOUT, ">$file")) 3. Take the output of #1 and
> pipe that into the perl subprocess.
>
> The problem is that perl waits for an end-of-file before starting
> execution, so the output of #1 is not ready by the time I get to #3. The
> main point of this is to preserve all the variables in perl's memory on
> the second pass, so closing perl is not an option.
>
> Is there a way to force perl to start executing before it gets to EOF? I
> guesss I'm basically asking for an interactive mode...

Your requirements are totaly unclear to me, but I guess you should start
with reading perldoc perlipc, especially the section "talking to
yourself".

HTH,
M4

Similar ThreadsPosted
recursive functions August 4, 2004, 9:59 am
how to use rdir in Net Ftp recursive December 21, 2006, 3:58 am
Net::FTP::Recursive hangs January 22, 2007, 2:55 pm
recursive filehandle August 19, 2008, 12:36 pm
Recursive directory removing? October 16, 2004, 6:22 pm
recursive function and hashe January 31, 2005, 3:48 pm
recursive module dependencies February 1, 2005, 4:18 pm
Recursive directory listing October 8, 2005, 7:32 pm
Recursive chmod/chown February 3, 2006, 10:46 am
Recursive Directory Traversal February 14, 2006, 10:50 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap