perl - Ambiguous use of -CONSTANT resolved as -&CONSTANT() -


As I told Perlsub, I am trying to declare magic numbers as constants in my Perl scripts. However, I receive warnings:

  $ cat foo.perl uses warnings; Strict use; Sub Constant () {5} Print 7-Constant, "\ n"; $ Perl foo.perl - The suspected use of Constant Foo.perl on line 3.   

The warning disappears if I insert a space between zero - & amp; CONSTANT () and constant . This expression wishes more than wind, but it works.

I'm curious, though: what warning does this warn me about?

(Pearl 5.10.1 from Debian "Squeeze").

First of all, let's look at some backgrounds for each other:

  $ _ = -foo;   

-foo is a string literally [1] .

  $ perl -Mstrict - WE'say -foo; '-foo   

Except that a sub-name has been declared foo .

  $ perl -Mstrict -wE'sub foo {123} say-foo; Suspicious use of '-foo - - 1-123   

Back to your question now - & amp; Resolved as foo (). Warning is incorrect one word ( 7 ) can not be performed by another TERM, hence - can not start a string, or a UNION MINUS operator. << Em> << em>

This warning is still 5.20.0 [2] / sup>. I have filed one.


  1. Look at me! No quotes!

      System (grep = & gt; (-R, $ pat, $ qfn));  
  2. Well, 5.20.0 is not out yet, but we are in a freeze code due to its release. It will not be decided in 5.20.0.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -