diff options
Diffstat (limited to 'lib/Config/Tree/Node/Null.pm')
-rw-r--r-- | lib/Config/Tree/Node/Null.pm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Config/Tree/Node/Null.pm b/lib/Config/Tree/Node/Null.pm new file mode 100644 index 0000000..f03e7a1 --- /dev/null +++ b/lib/Config/Tree/Node/Null.pm @@ -0,0 +1,26 @@ +package Config::Tree::Node::Null; +use parent 'Config::Tree::Node'; +use strict; +use warnings; +use Carp; + +sub is_null { 1 } + +our $AUTOLOAD; + +sub AUTOLOAD { + my $self = shift; + my $key = $AUTOLOAD; + $key =~ s/.*:://; + if ($key =~ s/^([A-Z])(.*)/\l$1$2/) { + return $self; + } + confess "Can't locate method $AUTOLOAD"; +} + +sub as_string { '(null)' } + +use overload + bool => sub { 0 }; + +1; |