minor tweak

This commit is contained in:
TLINDEN
2015-02-09 18:38:01 +01:00
parent b3b3098338
commit 395ac4f678
2 changed files with 10 additions and 6 deletions

View File

@@ -1,3 +1,6 @@
NEXT
signal value matches in search with quotes
0.04
fixed drop/append/pop/shift commands to work inside
arrays as well.

View File

@@ -21,7 +21,7 @@ no strict 'refs';
use Data::Dumper;
$Data::Interactive::Inspect::VERSION = 0.04;
$Data::Interactive::Inspect::VERSION = 0.05;
use vars qw(@ISA);
@@ -694,7 +694,7 @@ sub _search {
if (ref($db) =~ /hash/i) {
foreach my $key (sort keys %{$db}) {
$self->_searchmatch($key, $regex);
$self->_searchmatch($key, $regex, 0);
push @{$self->{spath}}, $key;
$self->_search($db->{$key}, $regex);
pop @{$self->{spath}};
@@ -710,16 +710,17 @@ sub _search {
}
}
else {
$self->_searchmatch($db, $regex);
$self->_searchmatch($db, $regex, 1);
}
return 1;
}
sub _searchmatch {
my ($self, $key, $regex) = @_;
my ($self, $key, $regex, $quote) = @_;
$quote = $quote ? '"' : '';
if ($key =~ /$regex/) {
print join(' => ', @{$self->{spath}}) . ": $key\n";
print join(' => ', @{$self->{spath}}) . ": ${quote}$ {key}${quote}\n";
}
}
@@ -1142,6 +1143,6 @@ and/or modify it under the same terms as Perl itself.
=head1 VERSION
This is the manual page for L<Data::Interactive::Inspect> Version 0.04.
This is the manual page for L<Data::Interactive::Inspect> Version 0.05.
=cut