Hash::Digger - Access nested hash structures without vivification
Version 0.0.5
Allows accessing hash structures without triggering autovivification.
my %hash;
$hash{'foo'}{'bar'} = 'baz';
diggable \%hash, 'foo', 'bar';
# Truthy
diggable \%hash, 'xxx', 'yyy';
# Falsey
dig \%hash, 'foo', 'bar';
# 'baz'
dig \%hash, 'foo', 'bar', 'xxx';
# undef
exhume 'some default', \%hash, 'foo', 'bar';
# 'baz'
exhume 'some default', \%hash, 'foo', 'xxx';
# 'some default'
# Hash structure has not changed:
use Data::Dumper;
Dumper \%hash;
# $VAR1 = {
# 'foo' => {
# 'bar' => 'baz'
# }
# };
dig, diggable, exhume
Check if given path is diggable on the hash (`exists` equivalent)
Dig the hash and return the value. If the path is not valid, it returns undef.
Dig the hash and return the value. If the path is not valid, it returns a default value.
https://github.com/juliodcs/Hash-Digger
Julio de Castro, <julio.dcs at gmail.com>
Please report any bugs or feature requests to bug-hash-digger at rt.cpan.org
, or through
the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Hash-Digger. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Hash::Digger
You can also look for information at:
-
RT: CPAN's request tracker (report bugs here)
-
CPAN Ratings
-
Search CPAN
This software is Copyright (c) 2020 by Julio de Castro.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)