From: Jeff 'japhy' Pinyan <[EMAIL PROTECTED]>
> On Nov 15, EternalLifeThereAfter said:
>
> >Whilst playing with filehandles, I noted that if the
> >unquoted-open-filehandles is in lower case it produces the following
> >warnings => "Unquoted string "justaname" may clash with future reserved
> >word at misc.pl line 3."
>
> >(Q1) I just wonder what's the reasons for having warnings on lower-case
> >filehandles as uppercase-open-handles does not produce warnings.
>
> What about the hundreds of people who open their logfiles with the
> filehandle "log"? (Hint: 'log' is a reserved word.)
And the UPPERCASE cannot trigger a warning because of
backwards compatibility. Everybody's using that.
> >(Q2) However, if I put single or double quotes on the filehandles,
> >everything seems fine. Am I therefore right to say that it is better to
> >put quotes on filehandles, irregardless of uppercase-open-handles or
> >lowercase-open-handles.
>
> Well, quoting a word makes it NOT a bareword, and so it can't be a
> reserved word. But quoting filehandles is a bad idea -- it makes things
> symbol when they needn't be, and I don't think strict appreciates it.
>
> (I might be wrong with that last one.)
I think you are right.
IMHO it's best to use normal scalars fro filehandles:
use FileHandle;
my $fh;
open $fh, "<$filename" or die "...";
that way the filehandles may be lexical and thus safe!
(No I don't do this always, especialy in older scripts or modules.)
Jenda
=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
--- me
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]