develooper Front page | perl.perl5.porters | Postings from May 2008

[perl #53806] No complain about bareword

Thread Next
From:
Ronald Fischer
Date:
May 7, 2008 03:13
Subject:
[perl #53806] No complain about bareword
Message ID:
rt-3.6.HEAD-20841-1210143305-1155.53806-75-0@perl.org
# New Ticket Created by  Ronald Fischer 
# Please include the string:  [perl #53806]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=53806 >


I found this error in Perl 5.8.8 for Cygwin (which is the most recent
Cygwin Perl
at the moment), and in Perl 5.8.7 for Solaris (which is a bit outdated,
as I have
to admit). The error goes like this:

No error is issued on the following program:

   perl -w -e 'use strict; print(Does::Not::Exist,"\n")'

Instead, "Does::Not::Exist" is printed. Similarily, the program

   perl -w -e 'use strict; system(Does::Not::Exist,"\n")'

results in the message

   Can't exec "Does::Not::Exist": No such file or directory at -e line
   1.

which too seems to suggest that Does::Not::Exist is simply interpreted
as string. But when I use it like this:

   perl -w -e 'use strict; print(ref(Does::Not::Exist),"\n")'

I get the reasonable message:

   Bareword "Does::Not::Exist" not allowed while "strict subs" in use at
   -e line 1. 

Ronald
-- 
Ronald Fischer <ronaldf@eml.cc>
+  If a packet hits a pocket on a socket on a port, 
+  and the bus is interrupted and the interrupt's not caught,
+  then the socket packet pocket has an error to report.
+		(cited after Peter van der Linden)


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About