in reply to Reading programs output into a Scalar - How?

I'm a bit too tired to figure out if what you're trying to do is even possible with a piped open to self, but this:
open( STDOUT, "|-" ) or die ("Can't open standard output: $!\n");
Is definitely wrong: it'll fork the process and then both processes will proceed and will try to do the same thing.

You'll want to split the task between the parent (who can write to the child) and the child (who can read from STDIN - NOT STDOUT!).

my $pid = open( CHILD, "|-" ); unless (defined $pid) { die ("Can't open standard output: $!\n"); } if ($pid) { # in parent process (will write to CHILD) } else ($pid) { # in child process (will read from STDIN) }

Also see perlipc.

update:

After some re-reading of your code, something like this will probably work too, and it's a LOT less complicated:

my $output = `program -text -brief clone_error <<EOF $form r clone_from=$clone_from r EOF`;
In other words, unless you really need to react to the programs output while it's running - i.e. you need to adjust the program's input based on it's output - you don't need to open a read/write pipe at all. Just supply all the input in one go and collect the output later.