+
Point of view
All features
class PERL
Summary
This class allows to have an embedded Perl interpreter in your program. With this interpreter, you can "execute" any line as you would do in a Perl script, even lines such as "use strict;" or "use somepackage", lines with "require" (in perlfunc) and "do" (in perlfunc to include external Perl files). See tutorial/perl for examples.
The compilation process needs perl developpement to be installed (libperl-dev package on Debian). Compile options for the C compiler are determined with command 'perl -MExtUtils::Embed -e ccopts' and linker option with command 'perl -MExtUtils::Embed -e ldopts' Perl 5.6.0 or above is required.
Note that current release does not allow to have multiple interpreters running, so this class is a singleton. If you need multiple interpreters, documentation is available in manual perlembed (provided in standard Perl documentation and available on the net). Please contribute and send your changes!
Direct parents
Insert list: SINGLETON
Class invariant
Overview
Creation features
{ANY}
Features
{}
{ANY}
Perl code execution
{ANY}
  • instruction (command: STRING)
    command is evaluated as an instruction (no result).
  • expression (command: STRING)
    command is evaluated and the result is reachable with last_* functions.
Reading values from Perl
{ANY}
{}
{ANY}
  • is_equal (other: PERL): BOOLEAN
    Is other attached to an object considered equal to current object?
{}
make
effective procedure
{}
interpreter_started: BOOLEAN
writable attribute
{ANY}
destroy
effective procedure
{ANY}
instruction (command: STRING)
effective procedure
{ANY}
command is evaluated as an instruction (no result).
expression (command: STRING)
effective procedure
{ANY}
command is evaluated and the result is reachable with last_* functions.
existant_variable (variable_name: STRING): BOOLEAN
effective function
{ANY}
Check if some Perl variable with the name variable_name does exist.
defined_variable (variable_name: STRING): BOOLEAN
effective function
{ANY}
Returns True if the Perl variable with the name variable_name does not have the Perl undef value.
read_variable (variable_name: STRING)
effective procedure
{ANY}
Read the Perl variable with name variable_name.
last_result_is_integer: BOOLEAN
effective function
{ANY}
True if the result of the last interpreted expression or read variable is of integer type.
last_integer: INTEGER_32
effective function
{ANY}
Access to the result of the last interpreted expression or read variable when it is of integer type.
last_result: POINTER
writable attribute
{}
start_perl_interpreter
{}
eval_command (string: POINTER, boolean: BOOLEAN)
{}
eval_expression (string: POINTER, boolean: BOOLEAN): POINTER
{}
return type is SV*
sv_ok (sv_star: POINTER): INTEGER_32
{}
get_sv (string: POINTER, boolean: BOOLEAN): POINTER
{}
return type is SV*
sv_is_int (sv_star: POINTER): INTEGER_32
{}
sv_to_int (sv_star: POINTER): INTEGER_32
{}
perl_interpreter_destroy
{}
is_equal (other: PERL): BOOLEAN
effective function
{ANY}
Is other attached to an object considered equal to current object?
is_real_singleton: BOOLEAN
effective function
{}
singleton_memory_pool: HASHED_DICTIONARY[POINTER, STRING]
once function
{}
This pool is unique in the whole system.
current_is_not_an_expanded_type: BOOLEAN
effective function
{}
Check that the dynamic type of the SINGLETON is not an expanded type.