Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Traversing directories recursively

by johngg (Canon)
on Nov 20, 2007 at 10:33 UTC ( #651897=note: print w/replies, xml ) Need Help??


in reply to Traversing directories recursively

By choosing a different regex delimiter and using a ? (0 or 1) quantifier you can make this line

next if ( "$dir_name/$file" =~ /\/\.$/ or "$dir_name/$file" =~ /\/\.\. +$/ );

simpler and more readable

next if "$dir_name/$file" =~ m{/\.\.?$};

Cheers,

JohnGG

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2019-07-17 02:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?