Thanks Damien ! >>Unquoted string "justaname" may clash with future reserved word ......"<<
The above seems to imply that it is better to put quotes on file-handles. Therefore to prevent clashes with future-reserved-keywords, would I be right to say that it is better to put quotes on filehandles. Of course I know that to use open-files-handles in UPPERCASE is the best. Thanks ----- Original Message ----- From: "Damien Carbery" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 16, 2001 3:02 AM Subject: [PBML] Re: open filehandle in lowercase produce warning, why? > Most of perl's keywords are lowercase e.g. chomp, open etc. > Your unquoted string looks like a keyword. > As perl is always being developed, this unquoted string could be a > keyword in the future and your script wouldn't compile in that future > version. > Quotes clarifies what you intend the string to mean. > > --- In [EMAIL PROTECTED], "EternalLifeThereAfter" > <[EMAIL PROTECTED]> wrote: > > 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. > > > > (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. > > > > #!d:\sambar50\perl\perl.exe -w > > use CGI::Carp (fatalsToBrowser); ## I always forgot the s in fatal, > is there a way out. > > open (justaname, 'anyfile.txt') || die "$!"; > > chomp (@file = <justaname>); > > close ('justaname'); > > print @file,"\n"; > > > > > > Thanks _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]