in reply to Don't close filehandles (was: To Kill a Meme: while(defined($line = <>)) )
in thread To Kill a Meme: while(defined($line = <>))
Isn't it at least theoretically possible for close to return an error? I'm not sure what, if anything could be done to rectify it if it did, but it could be used to alter the course of the rest of the program, even if it was only to log an error and exit.
Is there any way of trapping and handling such an error if you allow an unclosed lexical filehandle to just go out of scope?
I guess if you where using IO::*, you could subclass the DESTROY method, but would the filehandle still be open at that point? Or would an error code be accessible?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Don't close filehandles (was: To Kill a Meme: while(defined($line = <>)) )
by Abigail-II (Bishop) on Nov 03, 2003 at 21:38 UTC | |
by BrowserUk (Patriarch) on Nov 03, 2003 at 21:59 UTC | |
by Abigail-II (Bishop) on Nov 03, 2003 at 22:08 UTC |