Data::Hopen::Util::Data - general-purpose data-manipulation functions
Nothing is exported by default --- specify :all if you want it all.
:all
Convert a scalar to a Boolean as Perl does, except:
Falsy
/^(false|off|no)$/i
Truthy
"0"
So false, off, no, empty string, undef, and numeric 0 are falsy, and all other values (including string '0') are truthy.
false
off
no
undef
0
'0'
Clones a scalar or a reference. Thin wrapper around "dclone" in Storable.
Yet Another routine for dedenting multiline strings. Removes the leading horizontal whitespace on the first nonblank line from all lines. If the first argument is a reference, also trims for use in multiline q()/qq(). Usage:
q()
qq()
dedent " some\n multiline string"; dedent [], q( very indented ); # [] (or any ref) means do the extra trimming.
The extra trimming includes:
Removing the initial \n, if any; and
\n
Removing trailing horizontal whitespace between the last \n and the end of the string.
Returns a list of key-value pairs extracted from a given hashref. Usage:
my %forwarded_opts = forward_opts(\%original_opts, [option hashref,] 'name'[, 'name2'...]);
If the option hashref is given, the following can be provided:
If truthy, lower-case the key names in the output
If present, add - to the beginning of each name in the output. This is useful with Getargs::Mixed.
-
Return truthy if the given parameters are identical objects. Taken from Test::Identity by Paul Evans, which is licensed under the same terms as Perl itself.
To install Data::Hopen, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Hopen
CPAN shell
perl -MCPAN -e shell install Data::Hopen
For more information on module installation, please visit the detailed CPAN module installation guide.