"Tom Phoenix" <[EMAIL PROTECTED]> writes:

> On 12/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> John W.Krahn <[EMAIL PROTECTED]> writes:
>> > perldoc -f rewinddir
>>
>> Is that faster or anything than using a second opendir?
>
> Is it faster? What did you find out when you benchmarked both ways of coding 
> it?

When I started trying to test it, I couldn't get rewind to even work
so rather than embarking on new mission and debugging that, I wanted
to stay on the current mission and see if a knowledgable poster might
know the answer off the top of his/her head.

What may seem a minor debug to you experienced perl people could well
have melted away the rest of my night I planned to spend getting the
basic script functional.

In the end I left the 2 opendir calls.

> In any case, when you're reading a directory, you're reading data from
> a disk; the large potential disk latency will swamp any processing
> that Perl or your OS has to do, except perhaps in unusual situations.

> Is it "or anything"? There's no great advantage that I can see, other
> than whatever makes your algorithm easy to understand.
>
> Don't sweat the small stuff; let your perl binary worry about making
> your programs run "fast".

When someone with John's experience mentions it, there is a good
chance its based on something that I would benifit from hearing.  In
this case, as he pointed out, it was based on my asking if it were
possible.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to