Apologies for the delay, had to fetch File::Finder as it's not in the core perl and I wanted to have both methods detailed in the script.

Here's a testcase:

#!/usr/bin/perl # pragmata use warnings; use strict; use integer; # Modules use File::Finder; # merlyns wrapper around File::Find use File::Find; # core module # Prototypes sub wanted; sub dangling_symlink_handler; sub goFinder($); sub goFind($); # my $pathname = shift; chomp ($pathname); print "Querying Perhaps Broken Symlink Handling For $pathname \n"; # # generic find should grab anything and get anything that is valid print "call goFinder:\n"; goFinder($pathname); print "done goFinder:\n"; print "call goFind:\n"; goFind($pathname); print "done goFind:\n"; ################################################################### sub goFinder($){ my $searchpath = shift (@_); my @goodlinks = (); my @badlinks = (); print "in goFinder($searchpath)\n"; # Slightly modified merlynish example @goodlinks = File::Finder->eval(sub { -l and -e })->in($search +path); foreach (@goodlinks) { print "File::Finder Found good link:$_"."\n"; } @badlinks = File::Finder->eval(sub { -l and not -e })->in($sea +rchpath); foreach (@badlinks) { print "File::Finder Found bad link:$_"."\n"; } print "exiting goFinder($searchpath)\n"; } sub goFind($) { my $searchpath = shift (@_); print "in getFileList($searchpath)\n"; find( { wanted => \&wanted, no_chdir => 1, dangling_symlinks = +> \&dangling_symlink_handler }, $searchpath); print "exiting getFileList($searchpath)\n"; } sub wanted { print "\tWanted Sees This:\n\t".$File::Find::name."\n"; } sub dangling_symlink_handler { print "\tDangling Symlink Handler Sees This:\n\t".$File::Find: +:name."\n"; }

So there it is, the stock File::Find find function doesn't call the dangling_symlink_handler as advertised (or as I read it's advertisment) and your File::Finder module finds stuff just fine, either it works around this behavior properly or I'm misunderstanding its behavior. As File::Finder is not a core module, I hadn't used it up 'til now thus avoiding convincing my superiors to allowing its installation.

Squibbie Pooh Ski Doo.

In reply to Re^3: What's broken in Perl 5? by fraterm
in thread What's broken in Perl 5? by tlm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.