File: fastsearch.pl

package info (click to toggle)
libfile-map-perl 0.71-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 784 kB
  • sloc: perl: 365; ansic: 97; makefile: 3
file content (19 lines) | stat: -rwxr-xr-x 355 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /usr/bin/perl

use 5.010;
use strict;
use warnings;

use File::Map qw/map_file advise/;

die "Not enough arguments given\n" if @ARGV < 2;

my $regex = shift;
$regex = qr/$regex/;

for my $filename (@ARGV) {
	map_file my($map), $filename;
	advise $map, 'sequential';
	my $match = $map =~ $regex ? "" : "n't";
	say "File '$filename' does$match match";
}