The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!/usr/local/bin/perl -w
use strict;
use vars qw(%ref %def);
require "process_object";

my $file;
foreach $file (grep(!/_f\./,glob('*.n')),'../tkGlue.o','/usr/openwin/lib/libX11.so')
 {
  print STDERR "Scanning $file\n";
  do_nm($file);
 }

@ARGV = glob('*.t') unless (@ARGV);

my $tab;
foreach $tab (@ARGV)
 {
  my $count = 0;
  my $x = $tab;
  $x =~ s/\.t$/.qexc/;
  my %func;
  open(T,"<$tab") || die "Cannot open $tab:$!";
  chmod(0644,$x);
  open(X,">$x")   || die "Cannot open $x:$!";
  print STDERR "Checking $tab\n";
  while (<T>)
   {
    if (/^VFUNC\([^,]*,([A-Za-z][A-Za-z0-9_]*)/)
     {
      unless (exists($ref{$1}) || exists ($def{$1}))
       {
        print X "$1\n"; 
        $count++;
       }
     }
   }
  close(X); 
  unlink($x) unless ($count);
  close(T);
 }