Inline::Ruby

Inline::Ruby module can help you write Perl subroutines and classes in Ruby.
Download

Inline::Ruby Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Neil Watkiss
  • Publisher web site:
  • http://search.cpan.org/~neilw/Inline-ASM-0.03/ASM.pod

Inline::Ruby Tags


Inline::Ruby Description

Inline::Ruby module can help you write Perl subroutines and classes in Ruby. Inline::Ruby module can help you write Perl subroutines and classes in Ruby.SYNOPSIS print "9 + 16 = ", add(9, 16), "n"; print "9 - 16 = ", subtract(9, 16), "n"; use Inline Ruby; __END__ __Ruby__ def add(a, b) a + b end def subtract(a, b) a - b endThe Inline::Ruby module allows you to put Ruby source code directly "inline" in a Perl script or module. It sets up an in-process Ruby interpreter, runs your code, and then examines Ruby's symbol table, looking for things to bind to Perl.The process of interrogating the Ruby interpreter only occurs the first time you run your Ruby code. The namespace is cached, and subsequent calls use the cached version. Of course, your Ruby code must still be run every time your run the Perl script -- but Inline::Ruby already knows the results of running it.Using the Inline::Ruby ModuleUsing Inline::Ruby will seem very similar to using any other Inline language, thanks to Inline's consistent look and feel.This section will explain the different ways to use Inline::Ruby. For more details on Inline, see 'perldoc Inline'.Importing FunctionsUsing functions defined in Ruby is just like using Perl subs. You just supply the source code to Inline::Ruby, and then use them. use Inline Ruby => Requirements: · Perl


Inline::Ruby Related Software