Search::Saryer - a perl interface of libsary
my $saryer = new Search::Saryer(filename=>'search.txt');
print $saryer->grep($pattern)
- new ( FILE )
- new ( OPTIONS )
- Create "Search::Saryer" object. If
creation process was failed, it returns undef. These following options are
avaiable.
- file
- This option is used to set the target file name.
- filename
- This option is the alias of "file".
- array
- This option is used to set the array file name. It can be omitted.
- arrayfile
- arrayfilename
- These options are aliases of
"array".
If it is required to specify the array file name cleary, the
following expression can be used.
Example:
$sary = new Search::Saryer( file => "foo", array => "bar" );
- destroy
- Destruct "Search::Saryer" object. It is
automatically called by destructor. It is unnecessary that this function
is called explicitly.
- grep ( PATTERN, [IGNORE_CASE] )
- Search for the PATTERN, and return the list of lines which include it.
When IGNORE_CASE is true, do case-insensitive search.
- look ( PATTERN, [START_TAG, END_TAG, IGNORE_CASE] )
- Search for the PATTERN, and return the list of regions which include it.
Each of them is surrounded by START_TAG and END_TAG. When IGNORE_CASE is
true, do case-insensitive search.
- enable_cache
- Enable the cache engine. Cache the search results and reuse them for the
same pattern later.
- search ( PATTERN )
- Search for the PATTERN, and return true if success.
- icase_search ( PATTERN )
- Do case-insensitive search for the PATTERN, and return true if
success.
- get_next_line
- get_next_context_lines
- get_next_tagged_region ( START_TAG, END_TAG )
- Get the next search result of search/icase_search.
- count_occurrences
- sort_occurrences