Sha256: 7c8ee9d28e5dfd2aee77e0fb2e1eaeac218b983045605c8b79acdd582457ff37

Contents?: true

Size: 702 Bytes

Versions: 4

Compression:

Stored size: 702 Bytes

Contents

require 'rubygems'
require 'ffi'

require 'perl/ffi_lib'
require 'perl/common'
require 'perl/interpreter'

module Perl
  include Perl::FFILib
  extend Perl::Common

  @initialized = false
  @mutex = Mutex.new

  def setup
    @mutex.synchronize do
      return if @initialized

      argc, argv = argv_to_ffi

      Perl.Perl_sys_init3(argc, argv, nil)

      at_exit { shutdown }
      @initialized = true
    end
  end
  module_function :setup

  def shutdown
    Perl.Perl_sys_term
    @initialized = false
  end
  module_function :shutdown

  def run(args)
    Interpreter.new.eval(args)
  end
  module_function :run
end

require 'perl/ext/hash'
require 'perl/ext/object'
require 'perl/ext/string'

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-perl-04.01.2011.2 lib/perl.rb
ruby-perl-04.01.2011.1 lib/perl.rb
ruby-perl-04.01.2011 lib/perl.rb
ruby-perl-0.99.15j lib/perl.rb