BeePack
view release on metacpan or search on metacpan
croak("string can only handle one value") if scalar @values > 1;
$bee->set_string($key,$values[0]);
} elsif ($type =~ m/^b/) {
croak("bool can only handle one value") if scalar @values > 1;
$bee->set_bool($key,$values[0]);
} elsif ($type =~ m/^a/) {
$bee->set($key,\@values);
} elsif ($type =~ m/^h/) {
croak("hash needs even number") if scalar @values % 2;
$bee->set($key,{ @values });
} else {
croak("Unknown type ".$type);
}
$bee->save;
} else {
my $val = $bee->get($key);
if (defined $val) {
my $ref = ref $val;
if ($ref eq 'ARRAY' || $ref eq 'HASH') {
print Dumper $val;
} else {
print $val;
}
}
}
} else {
for ($bee->keys) {
print $_."\n";
}
}
exit 0;
__END__
=pod
=head1 NAME
bee - Small application to handle bee files
=head1 VERSION
version 0.103
=head1 SYNOPSIS
# show keys
$ bee test.bee
# get key
# integer displays as ascii numbers
# bool displays as true or false
# nil value is not displayed
# arrays and hashs are displayed as Data::Dumper dump
$ bee test.bee key
# sample complex key, no need for escaping
$ bee test.bee web#img/background.jpg#content
# get is transparent on string
$ bee test.bee gzipped_value | gunzip -c
# set key to nil
$ bee test.bee key n
# set bool key
$ bee test.bee key b 0
# set integer key
$ bee test.bee key i 123
# set string key
$ bee test.bee key s "This is a test"
# set array key
$ bee test.bee key a "Peter Parker" "Bruce Banner" "Clark Jerome Kent"
# set hash key
$ bee test.bee key h \
spiderman "Peter Parker" \
hulk "Bruce Banner" \
superman "Clark Jerome Kent"
=head1 SUPPORT
IRC
Join #hardware on irc.perl.org. Highlight Getty for fast reaction :).
Repository
http://github.com/cindustries/perl-beepack
Pull request and additional contributors are welcome
Issue Tracker
http://github.com/cindustries/perl-beepack/issues
=head1 AUTHOR
Torsten Raudssus <torsten@raudss.us>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2020 by Torsten Raudssus.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
( run in 0.982 second using v1.01-cache-2.11-cpan-d06a3f9ecfd )