#!/usr/bin/perl -w
use strict;
use File::Find;

if (!@ARGV) { @ARGV = qw(.) };
my @links;

#find sub { print "$File::Find::name\n" if -l && !-e }, @ARGV;
find(sub { if (-l && !-e) { push(@links, $File::Find::name); }; }, @ARGV);

foreach my $file (@links) {
  if (-l $file) {
      if (defined(my $whither = readlink($file))) {
          print("$file points to $whither\n");
      } else {
          print("$file points nowhere: $!\n");
      }
  }
};

