#!/usr/bin/perl

use strict;

my $debug=$ARGV[0];

foreach my $file (`find /home/sigg/var/crossref/ -name '*.xml' -exec xmlwf {} \\;`) {
  chomp $file;
  ## parse out file name
  print "file is '$file' ... ";
  $file=~m|(.*):\d+:\d+: .*| or next;
  $file=$1;
  if(defined($debug)) {
    print "not cleared while debugging $file\n";
    next;
  }
  unlink $file or die "$@";
  print "cleared\n";
}
