use strict;
use warnings;

sub lic_file(){
   opendir(DIR,".") || return -1;
   while ($_ = readdir(DIR)){
      if (-f $_){
         if (/^license$/i){
            return 0;
         } elsif (/^copying$/i){
            return 0;
         } elsif (/^gpl$/i || /^lgpl$/i){
            return 0;
         } elsif (/^bsd$/i){
            return 0;
         }
      }
   }
   closedir(DIR);
   return 1;
}

sub process_files($$){
   my $dir = shift;
   my $actions = shift;
   sub process_files($$);

   opendir(DIR,$dir) || return 1;
   my @files = readdir(DIR);
   closedir(DIR);

   foreach (@files){
      chomp();
      next if (/^\./);
      if (-d "$dir/$_"){
         process_files("$dir/$_",$actions);
      } elsif (-f "$dir/$_"){
         foreach my $func (@{$actions}){
            $func->($_);
         }
      }
   }
   return 0;
}

sub printfile($){
   my $file = shift;
   print("$file\n");
}

return 1;
