|
Posted by Curtis on 02/23/07 23:19
Toby A Inkster wrote:
> rahulthathoo wrote:
>
>> I cant seem to understand how can i pass variables from the PHP script
>> to the Perl script and vice versa using exec?
>
> You could store all your variables in one big array, serialize() the
> array, and then pass it to Perl as STDIN. In Perl, you can then use Scott
> Hurring's implementation[1] of unserialize() to retrieve the data.
>
> Passing data back, again, in Perl bundle the data up into a Perl hash,
> serialize() it using Hurring's module, and then print it to STDOUT. PHP
> reads the STDOUT and unserializes the data.
>
> Easy peasy.
>
> ____
> 1. http://hurring.com/code/perl/serialize/
>
Ah, that's very cool. That's a very clever way to communicate data. :)
--
Curtis, http://dyersweb.com
[Back to original message]
|