Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: read closed directory handle?by lemming (Priest) |
on Jan 27, 2001 at 02:42 UTC ( [id://54659]=note: print w/replies, xml ) | Need Help?? |
You're closing the FILEHANDLE with close. I don't think a
warning is generated when trying to close a directory handle. If you use closedir, you'll wind up with nothing printed. Update: It doesn't hurt to check if you successfully close file or directory handles. That would show the error with the close, instead of closedir. My guess on why warnings and strict didn't show anything is that you used the variables involved, but that's only a guess. readline will bring up a warning on a closed filehandle, but readdir doesn't seem to care that's it tries reading a closed directory handle.
In Section
Seekers of Perl Wisdom
|
|