in reply to Recursive Class:Struct syntax error?

Hi, (I waited until you reached your own conclusions about Class::Struct ...) I recommend Path::Iterator::Rule for this kind of work.

Here I am looking at the shebang, mostly because it's cool, but you can of course use file extension, or file contents, or a custom routine, to find the files, and additionally you can pass each one found to a callback using the visitor option.

The chained methods allow the syntax to be rather concise.

use strict; use warnings; use feature 'say'; use PIR; my @dir = qw( bin js js/WATS php php/web_crawler ); say for PIR->new ->max_depth(0) ->file ->shebang(qr/#!.*(?:perl|php|node)\b/) ->all(@dir); __END__

Hope this helps!


The way forward always starts with a minimal test.