TITLE ^

Data::Escape - simple string escaping implemented in PIR

SYNOPSIS ^

    ...

    load_bytecode "library/Data/Escape.pir"

    .local pmc escape

    escape = find_global "Data::Escape", "String"

    str = escape( str, "'" )

    ...

DESCRIPTION ^

This library escapes data to make it usable in PIR and C code.

FUNCTIONS ^

This library provides the following function:

str = String( str, [char] )

A simple string escaping function.

str

The string to escape.

char

The quote character used for printing, either ' or ".

This function returns the quoted string.

AUTHOR ^

Jens Rieks <parrot at jensbeimsurfen dot de> is the author and maintainer. Please send patches and suggestions to the Perl 6 Internals mailing list.

HISTORY ^

Modifications by Jerry Gay to escape backslash and use character class ops.

COPYRIGHT ^

Copyright (c) 2004, the Perl Foundation.


parrot