Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Recursive Class:Struct syntax error?

by 1nickt (Canon)
on Dec 04, 2018 at 01:46 UTC ( [id://1226693]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-25 07:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found