Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Loop Break

by sundialsvc4 (Abbot)
on Jan 19, 2012 at 16:27 UTC ( #948809=note: print w/replies, xml ) Need Help??

in reply to Loop Break

The way that I routinely deal with things like this is to use File::Find, or File::Find::Object, or any one of their many brethren.

Basically, my thought is, a very complete and well thought out solution to this very well-known task is at my fingertips, so I’m gonna grab it and use it and move on.   I encourage you to do likewise.

Also, and on a more general level, sometimes file-searches will be disrupted by things that you do to those files or to the filesystem within that loop.   This seems to be particularly true in Microsoft Windows.   Therefore, my customary approach is to build the list-of-files first, explicitly close the search, and then to go back and process that list.   The exact details depending upon the number of files that I expect to see.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://948809]
[jdporter]: omg, I f love Perl!
[choroba]: say unpack 'H*', pack 'B*', $mask =~ /0b([01]+)/;
[choroba]: use C instead of H to get the decimal number
[erix]: ( no love like f love )
[choroba]: f* love

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2018-02-20 16:35 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (272 votes). Check out past polls.