Perl Syntax

Kevin C. Krinke kckrinke-eqjHHVKjh9GttCpgsWEBFlaTQe2KTcn/ at public.gmane.org
Wed May 25 21:18:33 UTC 2005


On Tue, 2005-05-24 at 22:03 -0400, Rick Delaney wrote:
<snipped for brevity>
> I only pointed it out because the only barewords in the discussion were
> hash keys.  The OP may already have "use strict" in the program and
> wonder what all the fuss is about.

The strict pragma condones bareword hash keys as well as bareword
function names but that's the extent of what I know of the strict pragma
and it's bareword policy.

All of the following work with strict:

  $hash{KEY}
  $hash{'KEY'}
  $hash{"KEY"}
  %hash = ( KEY => "value" );
  some_function( ARG => "arg" );
  sub SIMPLE_PI => 4.14;
  my $pi = SIMPLE_PI;

Note that these are just examples and won't work as is...

-- 
Kevin C. Krinke <kckrinke-eqjHHVKjh9GttCpgsWEBFlaTQe2KTcn/@public.gmane.org>
Open Door Software Inc.

--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list