[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

run perl script and capture the output

Li Chen

12/20/2006 4:25:00 AM

Hi all,

I need to run a perl script from Ruby and capture its output. I use the
following line in Ruby but it fails. Any input will be appreciated.

out=`perl c:\\Perl\\self\\back1\.pl`


Li

--
Posted via http://www.ruby-....

1 Answer

Paul Lutus

12/20/2006 5:36:00 AM

0

Li Chen wrote:

> Hi all,
>
> I need to run a perl script from Ruby and capture its output. I use the
> following line in Ruby but it fails.

Define "fails". What happened?

> Any input will be appreciated.
>
> out=`perl c:\\Perl\\self\\back1\.pl`

Is this really the line you used? How about this instead:

out=`perl c:\\Perl\\self\\back1.pl`

Or, because I have no way to test your Windows syntax:

out=`perl c:/Perl/self/back1.pl`

Also, if Perl has been installed correctly and the Perl script is written
reasonably well, you shouldn't need the "perl" command in the line.

If these alternatives fail, you will have to run some tests, and work up to
the script.

Tests like this:

out = `perl -v`

See what this puts in the "out" variable.

--
Paul Lutus
http://www.ara...