In article <newscache$1ymy6h$gu9$1 / news.sil.at>,
max  <max / solution-x.com> wrote:
>yes i have some perl libaries and no chance to use them via ruby
>directly. i postet this problem on monday and someone told me that. 
>so i have to communicate with the scrpits. i know that it is not versy
>good but i don't want to rewrite all from the perl libary whcih would
>take very long cause i didn't write it. 
>

What I did in a situation like this was to write a wrapper around my Perl 
library (in perl) that would take some arguments and return something, 
like so:

#in ruby:

somePerlReturnedValue = `perl MyLibWrapper #{someRubyValue}`

#Perl wrapper (I'm forgetting Perl so please forgive any errors here)
use MyLib
$returnVal = myLibFunc($ARGV[0])
print $returnVal

Now I suppose that if you need to return several things from Perl that you 
could parse a string that gets returned from the Perl side since I believe 
that the backticks return a String object.

Now here's a crazy idea:  What we had some sort of Inline::Perl that used 
YAML serialization to communicate between the two sides?  There are YAML 
serialization modules for both Ruby and Perl and they could be used to 
pass objects back and forth between the two languages.  An Inline::Perl 
module would just sort of make the underlying communication between the 
two transparent.  Certainly most of the builtin types like Arrays, Hashes, 
String and FixNums would be transportable, I'm not sure how user defined 
classes would transfer, however (YAML dudes: is this feasable?)

Phil
-- 
"Or perhaps the truth is less interesting than the facts?" 
Amy Weiss (accusing theregister.co.uk of engaging in 'tabloid journalism')
Senior VP, Communications
Recording Industry Association of America