bowei_99 has asked for the wisdom of the Perl Monks concerning the following question:
Of course, I havemy $FH = "DATA"; open $FH, "<", $filename or croak "Cannot open file $filename +- $!\n";
use strict;enabled, and would like to leave it that way. But because of that, I'm getting the following error when I run the code:
As you'd expect, line 105 is the open statement in the code above.Can't use string ("DATA") as a symbol ref while "strict refs" in use a +t parse.pl line 105.
I'm using perl 5.8.7, so I know I don't need to have
use Symbol qw( gensym );(according to PBP, pg. 204, it's only needed for versions less than 5.6). I'd also like to stay with the standard builtin modules, so it rules out using IO::File. Any thoughts?
-- Burvil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Indirect Filehandles + use strict = error
by spiritway (Vicar) on Mar 14, 2006 at 02:08 UTC | |
|
Re: Indirect Filehandles + use strict = error
by TheDamian (Vicar) on Mar 14, 2006 at 10:20 UTC | |
|
Re: Indirect Filehandles + use strict = error
by Tanktalus (Canon) on Mar 14, 2006 at 03:13 UTC | |
|
Re: Indirect Filehandles + use strict = error
by zer (Deacon) on Mar 14, 2006 at 02:29 UTC |