PerlSharp : Perl Namespace
Code

This type represents a code reference: an anonymous sub or a reference to a named sub.

public class Code : Value

Remarks
An example will be here one day.
Members

See Also: Inherited members from Value.

Constructors
Code(Interpreter, string)
Creates a new anonymous sub that contains the given code.
Code(Reference)
Creates a new code reference that points to the given code reference.
Methods
Call(object[] ) : Value
Calls the sub.
CallParams(params object[] ) : Value
Calls the sub.
Member Details
Code Constructor
public Code (Interpreter perl, string code)

Creates a new anonymous sub that contains the given code.

Parameters
perl
The context that will contain the code reference.
code
The Perl code that this sub will execute.
Exceptions
Type Condition
Perl.PerlEvalException If an error occured parsing the code.
Remarks
This constructor is not very safe. It's possible for a properly constructed code to immediately execute arbitrary Perl instructions.

Code Constructor
public Code (Reference code)

Creates a new code reference that points to the given code reference.

Parameters
code
The reference to point to.
Remarks
This constructor should rarely be used.

Call
public Value Call (object[] args)

Calls the sub.

Parameters
args
The arguments to pass to the sub.
Returns
The return value of the call.
Exceptions
Type Condition
Perl.PerlEvalException If an error occured during the call.

CallParams
public Value CallParams (params object[] args)

Calls the sub.

Parameters
args
The arguments to pass to the sub as a param array.
Returns
The return value of the call.
Exceptions
Type Condition
Perl.PerlEvalException If an error occured during the call.