http://qs321.pair.com?node_id=752083


in reply to Re: loop issue...
in thread loop issue...

Sounds like awfully familiar advice, doesn't it OP? :)

He's at least checking your open calls which is good, but he'll be kicking himself n months hence when he has to spend time chasing down why things don't work that a simple opendir( FOO, $dir ) or die "opendir '$dir': $!" would have caught.

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^3: loop issue...
by Nkuvu (Priest) on Mar 20, 2009 at 16:52 UTC

    The OP copied the lines for the open calls that I provided -- but skipped the rest of the script. Granted I missed the check on the readdir, but I also noted that (and at least failure there would just mean that @files would be empty, rather than trying to alter files in the wrong directory).

    I had hoped that the OP would see what was intended with the advice given, but I think that's too much to ask. I was toying with the idea of completely revising the script (I have a current script that's taking a very long time to execute, so have some downtime while I wait for it) but I think it would be rather pointless.

Re^3: loop issue...
by lomSpace (Scribe) on Mar 20, 2009 at 16:35 UTC
    I got the right output. Thanks!