| MozRepl documentation | Contained in the MozRepl distribution. |
MozRepl::Plugin::Repl::Search - The fantastic new MozRepl::Plugin::Repl::Search!
version 0.01
use MozRepl;
my $repl = MozRepl->new;
$repl->setup({ plugins => { plugins => [qw/Repl::Search/] } });
my @results = $repl->repl_search({
pattern => '^getElement',
context => 'document'
});
print join("\n", @results);
Add repl_search() method to MozRepl.
Search properties by regex on specified context.
Context object. See MozRepl.
Hash reference.
Context variable or value.
Search pattern string.
Toru Yamaguchi, <zigorou@cpan.org>
Please report any bugs or feature requests to
bug-mozrepl-plugin-repl-search@rt.cpan.org, or through the web interface at
http://rt.cpan.org. I will be notified, and then you'll automatically be
notified of progress on your bug as I make changes.
Copyright 2007 Toru Yamaguchi, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| MozRepl documentation | Contained in the MozRepl distribution. |
package MozRepl::Plugin::Repl::Search; use strict; use warnings; use base qw(MozRepl::Plugin::Base);
our $VERSION = '0.01';
sub execute { my ($self, $ctx, $args) = @_; $args->{context} ||= "this"; $args->{repl} = $ctx->repl; my $cmd = $self->process('execute', $args); my @result = $ctx->execute($cmd); return wantarray ? @result : join("\n", @result); }
1; # End of MozRepl::Plugin::Repl::Search __DATA__ __execute__ [% repl %].search([% pattern %], [% context %]); __END__