Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: File::Find Question

by jkeenan1 (Deacon)
on Oct 31, 2013 at 01:51 UTC ( [id://1060494]=note: print w/replies, xml ) Need Help??


in reply to File::Find Question

Your code is in severe need of simplification and cleanup before we can consider whether using File::Find would improve it.

For example, write off the bat I detected three variables which are declared but never used:

$size $name $SDIR
Get rid of them -- and while you're removing them, also delete all the commented-out code, which only serves as a distraction to those reading your post and trying to help you.

Next, note that on line 56 you assign $drive to $dirlist[0], and then within five lines you call for a loop over the contents of @dirlist. If you only have one entry in the list over which you are iterating, you can ditch the for loop as well.

Thank you very much.

Jim Keenan

Replies are listed 'Best First'.
Re^2: File::Find Question
by RockE (Novice) on Oct 31, 2013 at 12:26 UTC

    Thanks for your reply Jim I've cleaned it up as requested. $drive is usually a CD drive, there is always more than one file

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-26 01:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found