You are here: Re: Calling perl script from PHP « PHP Programming Language « IT news, forums, messages
Re: Calling perl script from PHP

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация