#!/usr/bin/perl -w

use ExtUtils::Manifest qw(maniread);

my $match = shift @ARGV;

$match =~ s/([][\^$()*.+?])/\\$1/g unless ($match =~ s,^/(.*)/$,$1,);

my $files = maniread;

for my $file (sort keys %$files) {
  open FILE, $file;
  while (<FILE>) {
    next unless m/$match/;
    print "$file:$.:$_";
  }
  close FILE;
}
