#!/usr/bin/perl -w
use strict;
use Text::CSV_XS;
my $csv = Text::CSV_XS->new ({ allow_whitespace => 1 });
my $file = 'CPANTS.txt';
my $pkg = shift or die "Usage: $0 REG_EXP\n";
open (F,$file);
my @lines = <F>;
close(F);
my $rc=0;
for my $row ( @lines ) {
    $,="\t";
    $\="\n";
    my $status = $csv->parse($row);
    if ( $status ) {
	my @fields = $csv->fields();
	$fields[1] =~ /$pkg/ and print @fields;
	$rc++;
    }
    else {
	warn "Failed[$rc]:\n\t$row";
	die $csv->error_diag."\n";
    }
}
