in reply to Expect doesn't work as Expected

Hi, just as a curiosity, to see if I could run units thru some form of IPC, I tried to run it with IPC::Open3. I had some trouble with it going into a runaway condition, until I added the -t (terse) switch. I also had trouble with getting the full output from the pipe after each prompt. But anyways, here is a running version.
#!/usr/bin/perl use warnings; use strict; use IPC::Open3; #interface to "units" calculator my $pid = open3(\*WRITE, \*READ, 0 , "units -t"); # terse mode #if \*ERROR is set to 0, STDERR is sent to STDOUT foreach ( '100 yards', '1 mile', '1 kilometer', '1 parsec', '1 foobar' +){ print WRITE "$_\n meters \n"; chomp(my $answer = <READ>); print "$_ = $answer meters\n"; } __END__

OUTPUT:

100 yards = 91.44 meters 1 mile = 1609.344 meters 1 kilometer = 1000 meters 1 parsec = 3.0856776e+16 meters 1 foobar = Unknown unit 'foobar' meters

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh