in reply to Scratching my head...
Change that to:
or perhaps:open INFILE, "$inputfn" or die "Error reading input file: $!\n";
open(INFILE, "$inputfn") || die "Error reading input file: $!\n";
The problem is the precedence of || and ",". In your code, if open fails to open $inputfn for any reason, it tries to "open" the die statement! Use parens to say what you really mean, or use the ultra-low priority "or" operator, which makes the comma act as you might expect.
(Of course, this applies to both of your opens. When in doubt, use parenthesis around all your function calls.)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Scratching my head...
by virtualsue (Vicar) on May 01, 2001 at 01:31 UTC | |
by turnstep (Parson) on May 01, 2001 at 01:37 UTC | |
by virtualsue (Vicar) on May 02, 2001 at 01:55 UTC | |
Re: Re: Scratching my head...
by buckaduck (Chaplain) on May 01, 2001 at 01:08 UTC | |
Re: Re: Scratching my head...
by spudzeppelin (Pilgrim) on May 01, 2001 at 01:27 UTC | |
by turnstep (Parson) on May 01, 2001 at 01:35 UTC | |
by spudzeppelin (Pilgrim) on May 01, 2001 at 02:18 UTC | |
by spudzeppelin (Pilgrim) on May 01, 2001 at 20:34 UTC |