in reply to Constructing STDIN for an external progam

Yeah, printing to a read-only filehandle isn't going to work :-)

How about redirecting the second program's STDIN so that it reads from your data. Something like this (untested).

# Read all the data from STDIN in the $buffer variable my $buffer = do { local $/; <STDIN> }; #Do a subtitution. $buffer =~s/essage/assage/sg; system("echo $buffer | perl printout.pl");

Update: Or what Ovid said. Much better idea.

--
<http://dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg