Shlomi Fish avatar Shlomi Fish committed 490ad76

Changed the POD.

Comments (0)

Files changed (1)

File-FindLines/module/lib/File/FindLines.pm

 
 =head1 NAME
 
-File::FindLines - The great new File::FindLines!
+File::FindLines - find records out of a stream that match certain qualities.
+(similar to grep(1).)
 
 =head1 VERSION
 
 
     use File::FindLines;
 
-    my $foo = File::FindLines->new();
-    ...
+    my ($re_s, $filename) = @ARGV;
 
-=head1 EXPORT
+    my $re = qr/$re_s/;
 
-A list of functions that can be exported.  You can delete this section
-if you don't export anything, such as for a purely object-oriented module.
+    open my $fh, '<', $filename
+        or die "Cannot open '$filename'"
+
+    my $finder = File::FindLines->new(
+        {
+            input => { code => sub { return scalar <$fh>; }, },
+            filter => sub {
+                my ($self, $record_obj) = @_;
+                return $record_obj->text_like($re);
+            }, 
+        }
+    );
+
+    while (my $match = $finder->next_text())
+    {
+        print "$match\n";
+    }
+
+    close($fh);
 
 =head1 SUBROUTINES/METHODS
 
-=head2 function1
+=head2 new
+
+Initializes a new object.
 
 =cut
 
 sub function1 {
 }
 
-=head2 function2
+=head2 next
+
+Returns a new record as an object.
+
+=head2 next_text
+
+Returns a new record as text.
 
 =cut
 
-sub function2 {
-}
-
 =head1 AUTHOR
 
-Shlomi Fish, C<< <shlomif at cpan.org> >>
+Shlomi Fish, L<http://www.shlomifish.org/>, C<< <shlomif at cpan.org> >> .
 
 =head1 BUGS
 
 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-FindLines>.  I will be notified, and then you'll
 automatically be notified of progress on your bug as I make changes.
 
-
-
-
 =head1 SUPPORT
 
 You can find documentation for this module with the perldoc command.
 
     perldoc File::FindLines
 
-
 You can also look for information at:
 
 =over 4
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.