NAME

Tie::Scalar::Escaped - a variable that gives you a safe value

SYNOPSIS

use Tie::Scalar::Escaped;
tie $filename <= Tie::Scalar::Escaped;
$filename = "MultiCase <and extended>";
open HANDLE, ">$filename" or die "$!";
# the previous line opens %multi%case%32%%60%and%32%extended%62%

DESCRIPTION

At FETCH time, some transformations are performed on the data in the scalar so it is expanded to only include characters in [0-9a-z%]. Upper case chars are preceded by a % and everything else is expanded into \%NN where NN is the ord of the character. % characters are doubled.

After tieing $e to Tie::Scalar::Escaped, ${tied $e} and Tie::Scalar::Escaped::unescape($e) are equivalent.

EXPORTS

an unescape function is provided to wrestle the escaped strings back into binary form, if needed

PLANS

better casing

internationalization may be weak, esp. in case issues. uc and lc are used for recasing, but the ranges are in terms of [A-Z] and [a-z] instead of the defined character classes for these things.

configurable escaping character

this module uses percentage-sign and there isn't a way to tell it to use something else.

HISTORY

0.01 20 May 2003

Original version, created to support a propsed patch to perlvar

AUTHOR

David Nicol, <davidnico@cpan.org>