App::Grepl::Results::Token - App::Grepl result by token type.


App-Grepl documentation  | view source Contained in the App-Grepl distribution.

Index


NAME

Top

App::Grepl::Results::Token - App::Grepl result by token type.

VERSION

Top

Version 0.01

SYNOPSIS

Top

OO interface to grepl's individual results.

    use App::Grepl::Results::Token;

    my $found = App::Grepl::Results->new( {
        file     => $file,
    } );
    $found->add_results( $token => \@results );

    print $found->file, "\n";
    while ( my $result = $found->next ) {
        print $result->token, "matched:\n";
        while ( my $item = $result->next ) {
            print "\t$item\n";
        }
    }

METHODS

Top

Class Methods

new

    my $grepl = App::Grepl::Results::Token->new( { 
        token   => 'pod',
        results => \@matching_pod,
    } );

Class Methods

token

 my $token = $result->token;
 $result->token($token);

Getter/setter for token type. Will croak if App::Grepl does not recognize the token type.

results

 my $results = $result->results;
 $result->results($results);

Getter/setter for results. Will croak if not passed an array reference.

next

 while ( defined ( my $result = $found->next ) ) {
     ...
 }

Returns the next result found.

Note that the iterator is destructive.

AUTHOR

Top

Curtis Poe, <ovid at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-app-grepl at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=App-Grepl. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc App::Grepl::Results::Token

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/App-Grepl

* CPAN Ratings

http://cpanratings.perl.org/d/App-Grepl

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=App-Grepl

* Search CPAN

http://search.cpan.org/dist/App-Grepl

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


App-Grepl documentation  | view source Contained in the App-Grepl distribution.