Eric Wilhelm > ApacheLog-Parser-v0.0.1 > ApacheLog::Parser::SkipList

Download:
ApacheLog-Parser-v0.0.1.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: v0.0.1   Source  

NAME ^

ApacheLog::Parser::SkipList - a list of skippable lines

SYNOPSIS ^

  my $skipper = ApacheLog::Parser::SkipList->new;
  my %regexps = $skipper->set_config(\%conf);
  # you'll typically build %regexps into some condition sub

  my $sw = $skipper->new_writer($skipfile);
  my $counter = 0;
  while(...) {
    ...
    $counter++;
    $some_condition and $sw->skip($counter);
  }

Later, while reading a file with a prepared skiplist:

  my $skipper = ApacheLog::Parser::SkipList->new;
  $skipper->set_config(\%conf);

  my $sr = $skipper->new_reader($skipfile);
  my $skip = $sr->next_skip;
  my $counter = 0;
  while(my $line = <$fh>) {
    if(++$counter == $skip) {
      $counter += $sr->skip_lines($fh);
      $skip = $sr->next_skip;
      next;
    }
    
    # then do more expensive stuff
    ...
  }

new

  my $skipper = ApacheLog::Parser::SkipList->new;

set_config

  my %regexps = $skipper->set_config(\%conf);

get_matcher

  my $subref = $skipper->get_matcher;

merge

Merge existing files (adjusting the offsets.)

  $skipper->merge($dest, $file, $offset, $file);

new_writer

  my $sw = $skipper->new_writer($skipfile);

new_reader

  my $sr = $skipper->new_reader($skipfile);

AUTHOR ^

Eric Wilhelm @ <ewilhelm at cpan dot org>

http://scratchcomputing.com/

BUGS ^

If you found this module on CPAN, please report any bugs or feature requests 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.

If you pulled this development version from my /svn/, please contact me directly.

COPYRIGHT ^

Copyright (C) 2007 Eric L. Wilhelm, All Rights Reserved.

NO WARRANTY ^

Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.

LICENSE ^

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: