From: Brian Candler Date: 2009-02-24T18:24:37+09:00 Subject: Re: Calling perl function in ruby Loga Ganesan wrote: > Likewise, instead of c I have to write a perl function and should call > it? > > Is there any way? Only by embedding a whole Perl interpreter inside your Ruby interpreter. Usually it's better to make the Perl code a completely separate process, and use some form of IPC to talk to it. Simplest to set up are probably HTTP, or XMLRPC over HTTP. It depends on your problem domain. Maybe starting a Perl process using IO.popen(...) and talking to it over (its) stdin/stdout will be easier. If the data is binary, then a simple binary protocol like (4 bytes length) followed by (N bytes of data) will be much faster than wrapping the request in XML and HTTP. -- Posted via http://www.ruby-forum.com/.