PerlSharp : Perl Namespace
Value

The Value type is the abstract supertype of all managed wrappers around Perl variables.

public abstract class Value

Remarks
The undef value in Perl is represented by a null object in the managed world.
Members

See Also: Inherited members from object.

Properties
RefType [read-only]
string. Returns a string representing what kind of value this is.
Operators
Conversion: Perl.Value to System.Boolean
Determines whether Perl would consider this value to be true.
Conversion: Perl.Value to System.String
Converts this Value to a string.
Conversion: Perl.Value to System.Int32
Converts this Value to an integer, if it is a Scalar.
Conversion: Perl.Value to System.Double
Converts this Value to a double, if it is a Scalar.
Member Details
Conversion
public static explicit operator bool (Value value)

Determines whether Perl would consider this value to be true.

Parameters
value
The Value to test.
Returns
Whether Perl considers this value true.
Remarks
Non-zero integer scalars are true. Other things too.

Conversion
public static explicit operator string (Value value)

Converts this Value to a string.

Parameters
value
The Value to convert.
Returns
A string representation of this Value. Returns the same as value.ToString().

Conversion
public static explicit operator int (Value value)

Converts this Value to an integer, if it is a Scalar.

Parameters
value
The Value to convert. It must be a Scalar or an exception is thrown.
Returns
An integer representation of this Value.
Exceptions
Type Condition
ArgumentException If value is not a Scalar.
Remarks
This is a convenience function. Don't use it unless you are sure the value is (or should be) a Scalar.

Conversion
public static explicit operator double (Value value)

Converts this Value to a double, if it is a Scalar.

Parameters
value
The Value to convert. It must be a Scalar or an exception is thrown.
Returns
A double representation of this Value.
Exceptions
Type Condition
ArgumentException If value is not a Scalar.
Remarks
This is a convenience function. Don't use it unless you are sure the value is (or should be) a Scalar.

RefType
public string RefType { get; }

Returns a string representing what kind of value this is.

Value
A string representation of the type of value this is.
Remarks
Possible values include SCALAR, HASH, ARRAY, CODE, GLOB, REF, Ref:(INNER-TYPE), or the name of a package for blessed references. This should be used for debugging purposes only. A better way to check what kind of value this is would be to test whether an instance of Value is an instance of one of its subtypes (Scalar, Array, Blessed, etc.)