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.
| [reply] [d/l] |
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.
| [reply] [d/l] [select] |
I got the right output. Thanks!
| [reply] |
...or, alternatively, use autoload; autodie; - which would have the effect of die()ing if a built-in fails, thus not unduly cluttering the code.
Update:
Thanx to Fletch, I did in fact mean autodie
A user level that continues to overstate my experience :-))
| [reply] [d/l] [select] |
Thanks for the help. I got the right output! | [reply] |