fixed list array

This commit is contained in:
Thomas von Dein
2017-04-04 23:26:57 +02:00
parent 395ac4f678
commit bec7d2b572
3 changed files with 121 additions and 111 deletions

View File

@@ -1,4 +1,9 @@
NEXT 0.06
fixed crash, which happened when one executed the
'list' command if inside an array. now we divert
to 'show' in such a case.
0.05
signal value matches in search with quotes signal value matches in search with quotes
0.04 0.04

View File

@@ -1,8 +1,8 @@
#!/usr/bin/perl #!/usr/bin/perl
# #
# Copyright (c) 2015 T.v.Dein <tlinden |AT| cpan.org>. # Copyright (c) 2015-2017 T.v.Dein <tlinden |AT| cpan.org>. All
# All Rights Reserved. Std. disclaimer applies. # Rights Reserved. Std. disclaimer applies. Artistic License, same as
# Artistic License, same as perl itself. Have fun. # perl itself. Have fun.
# #
@@ -21,7 +21,7 @@ no strict 'refs';
use Data::Dumper; use Data::Dumper;
$Data::Interactive::Inspect::VERSION = 0.05; $Data::Interactive::Inspect::VERSION = 0.06;
use vars qw(@ISA); use vars qw(@ISA);
@@ -580,8 +580,15 @@ sub edit {
sub list { sub list {
my $self = shift; my $self = shift;
if (ref($self->{db}) eq 'ARRAY') {
# already implements array listing
$self->show;
}
else {
print join "\n", sort keys %{$self->{db}}; print join "\n", sort keys %{$self->{db}};
print "\n"; print "\n";
}
return 1; return 1;
} }
@@ -589,8 +596,6 @@ sub list {
sub show { sub show {
my ($self, $indent) = @_; my ($self, $indent) = @_;
if (ref($self->{db}) =~ /array/i) { if (ref($self->{db}) =~ /array/i) {
my $pos = 0; my $pos = 0;
foreach my $item (@{$self->{db}}) { foreach my $item (@{$self->{db}}) {
@@ -1133,8 +1138,8 @@ http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data::Interactive::Inspect
=head1 COPYRIGHT =head1 COPYRIGHT
Copyright (c) 2015 by T.v.Dein <tlinden@cpan.org>. Copyright (c) 2015-2017 by T.v.Dein <tlinden@cpan.org>. All rights
All rights reserved. reserved.
=head1 LICENSE =head1 LICENSE
@@ -1143,6 +1148,6 @@ and/or modify it under the same terms as Perl itself.
=head1 VERSION =head1 VERSION
This is the manual page for L<Data::Interactive::Inspect> Version 0.05. This is the manual page for L<Data::Interactive::Inspect> Version 0.06.
=cut =cut

4
README
View File

@@ -44,7 +44,7 @@ BUGS
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data::Interactive::Inspect http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data::Interactive::Inspect
COPYRIGHT COPYRIGHT
Copyright (c) 2015 by T.v.Dein <tlinden@cpan.org>. All rights Copyright (c) 2015-2017 by T.v.Dein <tlinden@cpan.org>. All rights
reserved. reserved.
LICENSE LICENSE
@@ -52,4 +52,4 @@ LICENSE
under the same terms as Perl itself. under the same terms as Perl itself.
VERSION VERSION
This is the manual page for Data::Interactive::Inspect Version 0.01. This is the manual page for Data::Interactive::Inspect Version 0.06.