Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Perl Script Causing high CPU usage

by bulk88 (Priest)
on Sep 29, 2013 at 15:40 UTC ( #1056230=note: print w/replies, xml ) Need Help??


in reply to Perl Script Causing high CPU usage

Do a ` with ls or dir, then parse the output. Those 2 tools will use a faster/lower overhead OS call than perl would be using. You are also touching the disk repeatedly and unnecessarily by doing -f $ObjectName and -d $ObjectName many times in the logic tree instead of doing them once and caching the result to a scalar before the logic tree.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1056230]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2016-12-10 20:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (165 votes). Check out past polls.