DTA::CAB::Utils - generic DTA::CAB utilities
use DTA::CAB::Utils;
##========================================================================
## Functions: XML strings
$safe = xml_safe_string($str);
##========================================================================
## Functions: Deep recoding
$decoded = deep_decode($encoding,$thingy,%options);
$encoded = deep_encode($encoding,$thingy,%opts);
$recoded = deep_recode($from,$to,$thingy, %opts);
$upgraded = deep_utf8_upgrade($thingy);
##========================================================================
## Functions: abstract data path value
$val_or_undef = path_value($obj,@path);
No symbols are exported by default.
Supports the following export tags:
:xml ##-- xml_safe_string
:data ##-- path_value
:encode ##-- deep_encode, deep_decode, deep_recode, deep_utf8_upgrade
$safe = xml_safe_string($str);
Returns a string $safe similar to the argument $str which can function as an element or attribute name in XML.
$decoded = deep_decode($encoding,$thingy,%options);
Perform recursive string decoding on all scalars in $thingy. Does NOT check for cyclic references.
%options:
force => $bool, ##-- decode even if the utf8 flag is set
skipvals => \@vals, ##-- don't decode (or recurse into) $val (overrides $force)
skiprefs => \@refs, ##-- don't decode (or recurse into) $$ref (overrides $force)
skippkgs => \@pkgs, ##-- don't decode (or recurse into) anything of package $pkg (overrides $force)
$encoded = deep_encode($encoding,$thingy,%opts);
Perform recursive string encoding on all scalars in $thingy. Does NOT check for cyclic references.
%opts:
force => $bool, ##-- encode even if the utf8 flag is NOT set
skipvals => \@vals, ##-- don't encode (or recurse into) $val (overrides $force)
skiprefs => \@refs, ##-- don't encode (or recurse into) $$ref (overrides $force)
skippkgs => \@pkgs, ##-- don't encode (or recurse into) anything of package $pkg (overrides $force)
$recoded = deep_recode($from,$to,$thingy, %opts);
Wrapper for:
deep_encode($to,deep_decode($from,$thingy,%opts),%opts);
$upgraded = deep_utf8_upgrade($thingy);
Perform recursive utf_uprade() on all scalars in $thingy. Does NOT check for cyclic references.
$val_or_undef = path_value($obj,@path);
Gets the value of the data path @path in $obj.
Bryan Jurish <moocow@cpan.org>
Copyright (C) 2009-2019 by Bryan Jurish
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.24.1 or, at your option, any later version of Perl 5 you may have available.