#!/usr/bin/perl use strict; use lib './'; use Links qw/$IN $DB $CFG/; use GT::SQL; use GT::SQL::Condition; use CGI::Carp qw(fatalsToBrowser); local $SIG{__DIE__} = \&Links::fatal; Links::init('./'); print $IN->header(); # first of all, lets actually get rid of all the categories... my @links_list; my $table = $DB->table('Links'); my @error_codes = qw(404 401 204 403); foreach (@error_codes) { print "Code checking $_ \n"; my $sth = $table->select( { Status => "$_" } ) || die $GT::SQL::error; while (my $hit = $sth->fetchrow_hashref) { push(@links_list,"$hit->{ID}::$hit->{Status}"); } } foreach (@links_list) { my @sli = split("::",$_); print "Deleting $sli[0] (code $sli[1]) \n"; $table->delete( { ID => $sli[0] } ) or die $GT::SQL::error; }