Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: last/next/redo usages

by sundialsvc4 (Abbot)
on Mar 20, 2018 at 21:50 UTC ( #1211379=note: print w/replies, xml ) Need Help??

in reply to last/next/redo usages

The documentation for this package quite-clearly states that the supplied function will simply be called for every file that is found, and that its return value does not matter.   (The code as-written clearly implies that the original author did not know this.)

Therefore, I would advocate now re-writing the function so as to show clear awareness of this, such as:

File::Find::find( sub { return unless $File::Find::name; return unless (-r && !-d); push ( @files, substr($File::Find::name, 5) ); } , 'blib' );
After all, there’s really no need to subject your successor to similar poring-throughs of PerlDocs!

Replies are listed 'Best First'.
Re^2: last/next/redo usages
by Your Mother (Bishop) on Mar 21, 2018 at 02:59 UTC

    Since the reply before mine, Re^2: last/next/redo usages, was considered for edit/deletion with this remark, Bullying, ad hominem attack. Critique the code on its merits, I will critique the parent node and code on its merits.

    The code is broken and does not compile. I would point out where and how but the author has made clear a hundred, if not five hundred times, that he is a more experienced hacker than I am, than you are, and loves to talk about how everything is easy so I wouldn't want to insult him. Also, he never takes corrections or edits nodes to reflect mistakes, thereby improving the monastery; altogether an act foreign to this monk.

    The summary and advice of how and why to fix the sample code in the OP is otherwise surprisingly fine; until we read for comprehension. hurricup did not write the code, which is apparently abandoned by its CPAN author, and therefore can't take the broken code offered or even put it in a ticket and expect the author to do so and, as LanX pointed out, the OP did not even ask the question answered. Zero for three.

    This concludes the critique on the merits; a critique that would have gone in a -- and a shoebox under the bed if not for a Consideration. The merits being—as presented and considering the 30 years of experience behind that would be better served with a 9th grade English class and a little Rogerian therapy—none. Well, not quite none; at least Excel, SOAP, RPC, and threads were not brought up as solutions.

Re^2: last/next/redo usages
by LanX (Archbishop) on Mar 20, 2018 at 23:25 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1211379]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2020-01-29 07:27 GMT
Find Nodes?
    Voting Booth?