Lintian::SlidingWindow(3) | Debian Package Checker | Lintian::SlidingWindow(3) |
Lintian::SlidingWindow - Lintian interface to sliding window match
use Lintian::SlidingWindow; my $sfd = Lintian::SlidingWindow->new('<','someevilfile.c', sub { $_ = lc($_); }); my $window; while ($window = $sfd->readwindow) { if (index($window, 'evil') > -1) { if($window =~ m/software \s++ shall \s++ be \s++ used \s++ for \s++ good \s*+ ,?+ \s*+ not \s++ evil/xsim) { # do something like : tag 'license-problem-json-evil'; } } }
Lintian::SlidingWindow provides a way of matching some pattern, including multi line pattern, without needing to fully load the file in memory.
Each window consists of up to two blocks of BLOCKSIZE characters.
Originally written by Bastien ROUCARIES for Lintian.
2023-02-05 | Lintian v2.116.3 |