in reply to running perl script from php

I'm not attempting to be rude, but this is a PHP question and not a perl question. The simple code you are executing should be in PHP rather than perl. There's no need to use perl to manually assign an array and print it... any language can do that.


Grygonos

Replies are listed 'Best First'.
Re: Re: running perl script from php
by u914 (Pilgrim) on Dec 19, 2003 at 16:28 UTC
    Grygonos, i disagree with you.

    Clearly this is a stub or test script (as the OP noted below above, but it seemed obvious to me), and there are plenty of reasons one might want to call Perl from PHP

    Besides, i think this is a valid question purely for its academic value. Other seekers/posters will likely be able to find information they need from this topic; it is well-titled, succinct and asks a very specific question.

    So, i've downvoted your node, and voted NOT to remove/consider it the original question. It seemed fair to me to let you know why and so forth, even if this node ends up being very 'meta-perlmonks.'

    cheers!
    914

Re: Re: running perl script from php
by Anonymous Monk on Dec 19, 2003 at 15:38 UTC
    Thanks for the array advice - I've fixed that. The problem remains, though. I can't get any of my perl output into the php. I thought that a print in perl would write data to the $Result array in the php exec call. Is this not true? (This is just a test app - ultimately I want to extract some data form a csv file in the perl script.) Richard.

      Technically no, that's not correct. Perl writes to STDOUT. The exec() routine in PHP reads each line of the output and puts them in the $Result. There is no direct communication between PHP and Perl.