Module: Perl::Common
- Included in:
- Perl, Interpreter, Shell
- Defined in:
- lib/perl/common.rb
Constant Summary collapse
- PERL_EXIT_EXPECTED =
0x01
- PERL_EXIT_DESTRUCT_END =
0x02
Instance Method Summary collapse
-
#argv_to_ffi ⇒ Object
Returns a C-style tuple of <argc,argv> corresponding to the real arguments the application was invoked with.
-
#embedded_argv_to_ffi ⇒ Object
Returns a C-style tuple of <argc,argv> suitable for running an embedded Perl interpreter.
- #start ⇒ Object
- #stop ⇒ Object
Instance Method Details
#argv_to_ffi ⇒ Object
Returns a C-style tuple of <argc,argv> corresponding to the real arguments the application was invoked with.
31 32 33 |
# File 'lib/perl/common.rb', line 31 def argv_to_ffi array_to_ffi(ARGV) end |
#embedded_argv_to_ffi ⇒ Object
Returns a C-style tuple of <argc,argv> suitable for running an embedded Perl interpreter.
39 40 41 |
# File 'lib/perl/common.rb', line 39 def array_to_ffi(%w[-e 0]) end |
#start ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/perl/common.rb', line 6 def start Perl.setup argc, argv = @my_perl = Perl.perl_alloc Perl.perl_construct(@my_perl) Perl.curinterp[:Iexit_flags] |= PERL_EXIT_DESTRUCT_END Perl.perl_parse(@my_perl, nil, argc, argv, nil) Perl.perl_run(@my_perl) end |