|
From: A. Sinan Unur on 7 May 2008 15:21 sheinrich(a)my-deja.com wrote in news:41f43d75-d4cb-4633-95a9- e5b76af6a97c(a)c58g2000hsc.googlegroups.com: > On May 7, 1:45 pm, "A. Sinan Unur" <1...(a)llenroc.ude.invalid> wrote: > > ... >> Note the following cases: >> >> C:\t> perl -w -Mstrict -e "print Does,Not,Exist, qq{\n}" >> No comma allowed after filehandle at -e line 1. >> >> In this case, Does has a valid interpretation as a >> bareword filehandle. Thus, strict does not kick in. >> > But why is the first argument being taken here for a filehandle, in > spite of the comma, and not considered as namespace, as in your other > example? Well, it is a bareword. The most natural use of a bareword found following print is to specify a filehandle in the current package. The alternative to giving an error message would have been to print Does which is not what the programmer wanted in 99.9999% of cases of a bareword following a print followed by a comma. > It seems like only Strings containing :: (or ' ) qualify as possible > package names. No. DoESnoTExiST is also a valid package name. However, only ' and :: can be used as separators in a package name. Sinan -- A. Sinan Unur <1usa(a)llenroc.ude.invalid> (remove .invalid and reverse each component for email address) comp.lang.perl.misc guidelines on the WWW: http://www.rehabitation.com/clpmisc/
First
|
Prev
|
Pages: 1 2 Prev: Error in Handling Unicode(UTF16-LE) File & String Next: FAQ 4.2 Why is int() broken? |