String-Smart
view release on metacpan or search on metacpan
lib/String/Smart.pm view on Meta::CPAN
my $html1 = as html => $some_string;
my $html2 = as html => $html1;
Does I<not> result in double encoding. The encodings you request are
'absolute'. A path of transformations that will convert the string from
whatever its current encoding is will be computed and applied.
=cut
sub as($$) {
my ( $desired, $str ) = @_;
my @desired
= map { split /_/ } 'ARRAY' eq ref $desired ? @$desired : $desired;
unless ( blessed $str && $str->isa( __PACKAGE__ ) ) {
$str = bless { val => $str, rep => [] };
}
my @got_rep = $str->rep;
( run in 1.006 second using v1.01-cache-2.11-cpan-524268b4103 )