#!/usr/local/bin/perl -w

=head1 NAME

deletefiles.pl - a script for deleting files form the database

=head1 SYNOPSIS

deletefiles.pl  [B<-y>|B<-n>] file file file...


=head1 DESCRIPTION

The script will delete all questions with the given file name(s) from the
database

=head1 OPTIONS


=item B<-y>

Answer 'yes' to all questions

=item B<-n>

Answer 'no' to all questions


=head1 BUGS

The database, user and password are hardcoded. 

=head1 SEE ALSO

createindex.pl(1)

=head1 AUTHOR

Boris Veytsman

=head1 $Id: deletefiles.pl,v 1.1 2001/07/27 23:54:07 boris Exp $

=cut

    use strict;
use vars qw($opt_h $opt_y $opt_n);

use Getopt::Std;
use DBI;

MAIN: 
{
    my $USAGE="Usage: deletefiles.pl [-y|-n][-r] file file file...\n";
    getopts('ynh') or die $USAGE;
    if ($opt_h) {
	print $USAGE;
	exit 0;
    }
    my $decision='askuser';
    if ($opt_y) {
	$decision = 'yes';
    } 
    if ($opt_n ) {
	$decision = 'no';
    }
    my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "") 
	or die "Can't connect to DB chgk\n";

}

