in reply to Duplicates in Win32::DirSize
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Duplicates in Win32::DirSize
by Real Perl (Beadle) on Aug 19, 2005 at 19:08 UTC | |
Hope this helps, Claire | [reply] [d/l] |
by wink (Scribe) on Aug 20, 2005 at 01:40 UTC | |
For clarification, what kind of "hurtle" are you seeing? Is it messing up when it tries to itemCreate() because of the duplicate name? Is it reporting a wrong size? Are we talking duplicate full paths or just duplicate bottom-level folder names (c:/foo/bar/baz and c:/windows/baz, for instance)? While I'm here, you could make the code a little more concise:
Using x= (with x being some operator) is only more efficient when working with one additional value. Which looks better to you:
The latter involves less typing, looks much clearer, and is likely more efficient. Sorry to be nitpicky. I'm often anal about grammar and all things related (both in code and in language) [id://wink] waits for someone to find a grammar mistake in this reply (no, I didn't place one intentionally for anyone to find, but I likely made one). ;) | [reply] [d/l] [select] |
by Real Perl (Beadle) on Aug 21, 2005 at 03:50 UTC | |
Thank you very much to show me the efficient way of doing things. I am quite new at programming and I'm learning Perl on my own!! (with the Monks). Any way, I don't know how to clarirfy the hurtle. One thing I know is that if I have "user1, user2, user3 and then user1 again, the method calculates the right size for user1 then user2 and user3 and then gives me a long error message at the DOS prompt and eventhough the program goes on and displays what was calculated (that is done with the make_table method that I am not showing here), the program is not functional anymore and has to be closed. The duplicates are only in the user names. For example, I ask my program to go get the size for: C:\documents and settings\desktop\testfolder\ and then in a for loop I append the name of the folder under testfolder. I though of dealing with the duplicates before it even tries to calculate anything by sorting the array and checking if I have duplicates before I launch the method, but I have another issue with that. The issue is really embarrassing because Perl execute the if statement and the else statement also! Here is the all method: The outside if else statement works just fine it is just the if and else inside that does not act properly. I would be very appreciative if you could point out what I am doing wrong, as I am about ready to give up on checking for duplicate all together! Thanks, Claire | [reply] [d/l] |
by wink (Scribe) on Aug 21, 2005 at 06:17 UTC | |