SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

BotDetect - Real-Time Bot Detection API
 
 

MAN page from Mandriva 2010 ack-1.900.0-1mdv2010.0.noarch.rpm

Basic

Section: User Contributed Perl Documentation (3)
Updated: 2008-10-18
Index 

SYNOPSIS

Container for the Repository and Resources necessary. 

App::Ack::Resource::Basic

 

METHODS

 

new( $filename )

Opens the file specified by $filename and returns a filehandle anda flag that says whether it could be binary.

If there's a failure, it throws a warning and returns an empty list. 

$res->name()

Returns the name of the resource. 

$res->is_binary()

Tells whether the resource is binary. If it is, and ack finds amatch in the file, then ack will not try to display a match line. 

$res->needs_line_scan( \%opts )

API: Tells if the resource needs a line-by-line scan. This is a bigoptimization because if you can tell from the outset that the patternis not found in the resource at all, then there's no need to do theline-by-line iteration. If in doubt, return true.

Base: Slurp up an entire file up to 100K, see if there are anymatches in it, and if so, let us know so we can iterate over itdirectly. If it's bigger than 100K or the match is inverted, wehave to do the line-by-line, too. 

$res->reset()

Resets the resource back to the beginning. This is only called if"needs_line_scan()" is true, but not always if "needs_line_scan()"is true. 

$res->next_text()

API: Gets the next line of text from the resource. Returns trueif there is one, or false if not.

Sets $_ with the line of text, and $. for the ID number ofthe text. This basically emulates a call to "<$fh>". 

$res->close()

API: Close the resource. 

App::Ack::Repository::Basic

 

next_resource

Returns a resource object for the next resource in the repository. 

close

Does nothing. For the base repository, the opening & closing arehandled at the resource level.

If this repository were, say, an Excel workbook, you'd probablyclose the file. If it were a database, you'd close the databaseconnection.


 

Index

SYNOPSIS
App::Ack::Resource::Basic
METHODS
new( $filename )
$res->name()
$res->is_binary()
$res->needs_line_scan( \%opts )
$res->reset()
$res->next_text()
$res->close()
App::Ack::Repository::Basic
next_resource
close

This document was created byman2html,using the manual pages.
 
ICM Bot detect detector