Chris Hulan
4/7/2006 4:01:00 PM
sayoyo@yahoo.com wrote:
> Hi,
>
> Thanks for the information, but how can I get the results from our perl
> script.???
>
> actually, we find out that we can use this code:
>
> obj = IO.popen("/usr/bin/perl hello_world.pl world", "w+")
> obj.close_write
> toto = obj.gets
> obj.close
> puts toto
>
> but is there other way to do this?
>
> sayoyo
Well:
foo = `type readme.txt`
will put the contents of readme.txt into foo, so is good for grabbing
stdout from the external app
Or you can check out popen3 if you need separate acces to STDIN, STDOUT
and STDERR