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

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (13)
As of 2014-09-23 14:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (223 votes), past polls