src/classes/perlstring.pmc - Perl String


PerlString extends String to provide Perl-specific string behaviour. Note that the morph method comes from PerlScalar, not from String.

Methods ^

INTVAL get_integer()

Returns the integer representation of the string by converting to float first. See t/pmc/perlstring_13 set P0, "1.23e2" ; set I0, P0

STRING *get_repr()

Returns pythons string repr (w/o any escaping, just single quotes around)

void set_integer_native(INTVAL value)

Morphs the string to a PerlInt and sets its value to value.

void set_number_native(FLOATVAL value)

Morphs the string to a PerlNum and sets its value to value.

void morph(INTVAL type)

Morphs the PerlString to the specified type.

void increment()

void decrement()

These two methods are partially implemented. They should provide Perl 5 like string increment/decrement.

PMC *get_pmc_keyed(PMC *key)

Returns the string value for SELF[key].