|
Posted by Toby A Inkster on 02/23/07 11:19
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/
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
[Back to original message]
|