“max” max@solution-x.com schrieb im Newsbeitrag
news:newscache$gcdy6h$q77$1@news.sil.at…
i would like to call a perl script with ruby.
so i write puts ´perl test.pl´
these must backquotes like in:
puts perl test.pl
when you want to write a new perl script, then do it directly in ruby
instead. integrating a big perl script that you don’t want to rewrite
seems to me the only case where call integration like this is appropriate.
what features are there in perl that you miss in ruby?
how can i do it that my ruby programm gives the scrpit 1 and the perl
script adds one and gives the result back to my ruby script.
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.
thanks a lot for your answer. will try it then.
regards
max
Robert Klemme wrote:
···
“max” max@solution-x.com schrieb im Newsbeitrag
news:newscache$gcdy6h$q77$1@news.sil.at…
i would like to call a perl script with ruby.
so i write puts ´perl test.pl´
these must backquotes like in:
puts perl test.pl
when you want to write a new perl script, then do it directly in ruby
instead. integrating a big perl script that you don’t want to rewrite
seems to me the only case where call integration like this is appropriate.
what features are there in perl that you miss in ruby?
how can i do it that my ruby programm gives the scrpit 1 and the perl
script adds one and gives the result back to my ruby script.
how can ruby read the 2? it is somethinng with the stdin or?
when i do
puts perl test.pl 1
it outputs 2
nil
regards
max
Robert Klemme wrote:
···
“max” max@solution-x.com schrieb im Newsbeitrag
news:newscache$gcdy6h$q77$1@news.sil.at…
i would like to call a perl script with ruby.
so i write puts ´perl test.pl´
these must backquotes like in:
puts perl test.pl
when you want to write a new perl script, then do it directly in ruby
instead. integrating a big perl script that you don’t want to rewrite
seems to me the only case where call integration like this is appropriate.
what features are there in perl that you miss in ruby?
how can i do it that my ruby programm gives the scrpit 1 and the perl
script adds one and gives the result back to my ruby script.
Wednesday, December 11, 2002, 6:18:43 PM, you 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
if this libraries is not OO, you can use them. i wrote module which
permits use of perl functions inside ruby like this:
include “PerlInside”
print “a”.length, length(“a”)
second length is actually evaluated by perl.exe there is also
another library for calling perl functions from ruby, you can search
this on YARAA
“max” max@solution-x.com schrieb im Newsbeitrag
news:newscache$bany6h$7v9$1@news.sil.at…
works fine. very cool. thank you.
prints me 2.
how can ruby read the 2? it is somethinng with the stdin or?
when i do
puts perl test.pl 1
it outputs 2
nil
oops, i forgot this point. sorry!
result = perl test.pl 1
regards
robert
regards
max
Robert Klemme wrote:
“max” max@solution-x.com schrieb im Newsbeitrag
news:newscache$gcdy6h$q77$1@news.sil.at…
i would like to call a perl script with ruby.
so i write puts ´perl test.pl´
these must backquotes like in:
puts perl test.pl
when you want to write a new perl script, then do it directly in ruby
instead. integrating a big perl script that you don’t want to rewrite
seems to me the only case where call integration like this is
appropriate.
···
what features are there in perl that you miss in ruby?
how can i do it that my ruby programm gives the scrpit 1 and the perl
script adds one and gives the result back to my ruby script.
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:
#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?)
“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
this sounds interestimg. well i downloaded the client libaries for
OpenSRS which i should use to write a new client. So i don’t know this
libaries very good. The whole documentation shows examples in perl.
But for any reason we want to have it in ruby. The libary should be used
cause so we stay up to date without doin to much.
So what is 00? Perl is also quite new for me.
What is YARAA? Do you have a link?
thanks a lot for your time
max
This message has been automatically forwarded from the ruby-talk mailing list by a gateway at pragprog.com. If it is SPAM, it did not originate at pragprog.com. Please report the original sender, and not us. Thanks! wrote:
···
Hello max,
Wednesday, December 11, 2002, 6:18:43 PM, you 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
if this libraries is not OO, you can use them. i wrote module which
permits use of perl functions inside ruby like this:
include “PerlInside”
print “a”.length, length(“a”)
second length is actually evaluated by perl.exe there is also
another library for calling perl functions from ruby, you can search
this on YARAA
This message has been automatically forwarded from the ruby-talk mailing list by a gateway at pragprog.com. If it is SPAM, it did not originate at pragprog.com. Please report the original sender, and not us. Thanks! wrote:
This message has been automatically forwarded from the ruby-talk mailing list by a gateway at pragprog.com. If it is SPAM, it did not originate at pragprog.com. Please report the original sender, and not us. Thanks! wrote:
Hello max,
Wednesday, December 11, 2002, 6:18:43 PM, you 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
if this libraries is not OO, you can use them. i wrote module which
permits use of perl functions inside ruby like this:
include “PerlInside”
print “a”.length, length(“a”)
second length is actually evaluated by perl.exe there is also
another library for calling perl functions from ruby, you can search
this on YARAA
correct my last posting. it works now that i can communicate.
my lib is OO. thought u wrote 00. my mistage. ups.
Wednesday, December 11, 2002, 6:18:43 PM, you 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
if this libraries is not OO, you can use them. i wrote module which
permits use of perl functions inside ruby like this:
include “PerlInside”
print “a”.length, length(“a”)
second length is actually evaluated by perl.exe there is also
another library for calling perl functions from ruby, you can search
this on YARAA
Is your PerlInside on the RAA? I didn’t find it there.
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
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?)
Similarly, couldn’t one wrap XML-RPC around the perl code?
Oh, yes. It’s the essence of YAML’s existence. User-defined classes are
merely native types that are explicitly typed in YAML. So this is a Ruby
Hash in YAML:
On Wednesday 11 December 2002 01:01 pm, Phil Tomson wrote:
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?)
Wednesday, December 11, 2002, 11:01:03 PM, you wrote:
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,
i did this in general way. my library handles hashes/arrays of any
depth but don’t handle any class values
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.
good idea. i don’t know about yaml so i used pretty-print modules for
both languages
ps: it’s not on yaraa nor on this computer. i must carry this lib from
my home
b) the #! line of test.pl referes to the wrong path to perl
#!/usr/local/bin/perl ??
#!/usr/bin/perl ??
#!/bin/perl ??
etc.
this can, in somecases, be sidestepped by using
#!/usr/bin/env perl
or
#!/usr/local/bin/env perl
instead, depending on the path to env.
-a
···
On Wed, 11 Dec 2002, max wrote:
i wrote my test.pl with a print 2.
but when i execute output = test.pl
i get an error.
irb(main):001:0> output = test.pl
(irb):1: command not found: test.pl
“”
–
====================================
Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ahoward@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
====================================
SIGSIG – signature too long (core dumped)
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?)
Similarly, couldn’t one wrap XML-RPC around the perl code?
Sure, some form of XML serialization could be used too. I’m just partial
to YAML these days
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