From: Maran Chandrasekar Date: 2009-02-25T22:08:12+09:00 Subject: Re: Calling perl function in ruby Loga Ganesan wrote: > Ya, Here is the code to acheive it. But I don't know that whether it is > an efficient coding. > > > #! /usr/bin/ruby > # > require 'perl' downloaded from http://www.yoshidam.net/perl-0.2.9.tar.gz > > perl_obj = Perl.new() > > perl_obj.eval(" > #!/usr/bin/perl > use strict; > use warnings; > > sub factorial { > my $n = 1; > $n *= $_ for 2..shift; > return $n; > }") > > ret = perl_obj.call("factorial", 5) > > puts ret Yes, It is working. Nicely done, Loganathan -- Posted via http://www.ruby-forum.com/.