perlscriptstring(
TEXT
)

The perlscriptstring( function converts text into a Perl string literal.


Parameters

This function has one parameter:

text – the original text.


Description

This function converts text into an Perl string literal. To do this, the function surrounds the text with single quote characters, and escapes any single quote and/or backslash characters within the text. (Note: You could also use the applescriptstring( function to create a perl string literal that would be subject to variable substitution.) Use this function when you need a string literal inside the Perl statement or perl( function.

perlscriptstring({Make text into 'perl' "literal string"})
    ☞ 'Make text into \'perl\' "literal string"'

Note: This function is equivalent to:

{'}+replace(replace(thetext,{\},{\\}),{'},{\'})+{'}

See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.