On the off chance that you happen to be a fan of Ruby (and from what I'm hearing, it's worth looking into), you may be interested to know that Neil Watkiss has announced the initial release of Inline::Ruby. You can download it here. He states that the module has a lot of bugs and is incomplete, but he welcomes test cases and patches. Code from his announcement:
use Inline Ruby; my $obj = new Iterator(1, "2", [3], {4 => 5}); $obj->each_iter(sub { use Data::Dumper; my $element = shift; print "It looks like Ruby passed me this: ", Dumper($element); }); __END__ __Ruby__ class Iterator def initialize(*elements) @elements = elements end def each @elements.each { |x| yield x } end end
Output:
ttul:~/dev/cpan/Inline-Ruby$ perl -Mblib t.pl Using /home/nwatkiss/dev/cpan/Inline-Ruby/blib It looks like Ruby passed me this: $VAR1 = 1; It looks like Ruby passed me this: $VAR1 = [3]; It looks like Ruby passed me this: $VAR1 = '2'; It looks like Ruby passed me this: $VAR1 = {'4' => 5};
Other comments from his announcement:
I've tested it with Ruby 1.6.3 through 1.6.6, against Perl 5.6.0 and 5.6.1. I've only tried it on Linux so far. All helpers are welcome!
Some things which aren't working:
+ can't bind to functions (only classes & methods).
+ using iterators requires you to add "_iter" to the end of the method name (ugly, confusing)
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
In reply to Inline::Ruby by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |