All pastes #89043 Raw Edit

Anonymous

public text v1 · immutable
#89043 ·published 2006-07-15 18:21 UTC
rendered paste body
my @queue = qw(
  hellotheret
  hisissome
  randomstringd
  ata
);

my %match = (
  thisis => 1
);

#my $line_size = 5;
my $line_size = 11;
my $match_size = 6;

my $count = 0;
my $buffer = $queue[$count];
while(++$count < @queue) {
  $buffer .= $queue[$count];
warn "[$buffer] [$queue[$count]]\n";
  for my $pos (0..length($buffer)-$match_size) {
    my $query = substr($buffer,$pos,$match_size);
    if(exists $match{$query}) { print "Got a match\n" } }
  substr($buffer,0,$line_size) = '' }