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

Re^3: File existance check failure

by graff (Chancellor)
on Nov 12, 2012 at 03:05 UTC ( #1003361=note: print w/ replies, xml ) Need Help??

in reply to Re^2: File existance check failure
in thread File existance check failure

One more small detail, which probably won't be significant unless you happen to be scanning very large quantities of files, links and/or directories: you can use the special operand "_" (the underscore character) on the file-test operators, in order to use the file stat information from the previous stat call (so you don't do repeated stat calls on the same file). Adapting the most recent suggestion from Athanasius:

sub cleanup { for (glob $_[0]) { cleanup_link($_) when -l; cleanup_dir ($_) when -d _; cleanup_file($_) when -f _; } }

Comment on Re^3: File existance check failure
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2015-11-26 13:17 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (699 votes), past polls