in reply to syntax error with constant
Probably because -k looks too much like one of the -X filetest operators (eg. -s -e -d etc.).
If you use upper case for your constant names as is generally advised, the parser has an additional clue which it uses to work out the right way to parse the statement and does so, albeit that it issues a friendly warning in the process.
use constant K => 2; print 1 - K; -1 print 1 -K; Ambiguous use of -K resolved as -&K() at ... -1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: syntax error with constant
by liz (Monsignor) on Aug 03, 2003 at 22:42 UTC | |
by TomDLux (Vicar) on Aug 04, 2003 at 01:08 UTC | |
by liz (Monsignor) on Aug 04, 2003 at 07:30 UTC | |
by sgifford (Prior) on Aug 04, 2003 at 06:56 UTC |