On Fri, 9 Mar 2001, David Jourard wrote:
> Hi,
>
> In my startup.pl I'm calling a function that initializes read-only
> variables - read in from several text files.
>
> After it reads in the first it fails on every one thereafter with the message:
>
> Read on closed filehandle <SYS1> at lpinit.pl line 78
> Read on closed filehandle <SYS2> at lpinit.pl line 99
>
> etc..
>
> Here some sample code in lpinit.pl
[snip]
> open(SYS2, "$PathData/file2.txt");
> while (<SYS2>) {
> # Read in the data from file2
>
> }
> }
> close SYS2;
>
> It works for the first but fails for the 2, 3, 4, 5 and 6th.
>
> Any ideas whats causing the error.
Sure, have you ever thought of checking the return code of the open()
function?
open FOO, $foo or die "Here comes the error: $!";
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:[EMAIL PROTECTED] http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/