Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I know i can do this:open($test, "<test.txt"); if (!$test) { #do something } else { #use $test to print something }
but i really need to check for a valid filehandle after the open is complete. Is there a way to do this? thanks, Michaelopen($test, "<test.txt") || die("$!\n");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: valid filehandle
by jsprat (Curate) on Mar 20, 2003 at 23:47 UTC | |
|
Re: valid filehandle
by DaveH (Monk) on Mar 20, 2003 at 23:49 UTC | |
|
Re: valid filehandle
by Limbic~Region (Chancellor) on Mar 20, 2003 at 23:51 UTC | |
|
Re: valid filehandle
by BrowserUk (Patriarch) on Mar 21, 2003 at 00:48 UTC | |
by perlplexer (Hermit) on Mar 21, 2003 at 03:56 UTC | |
|
Re: valid filehandle
by Vorlin (Beadle) on Mar 21, 2003 at 00:46 UTC | |
|
Re: valid filehandle
by Anonymous Monk on Mar 21, 2003 at 14:41 UTC |