in reply to Re: " - " in the syntax
in thread " - " in the syntax
This got me curious
$ perl -MO=Deparse -e 'print $q -> start_html(-title => "The Time", -b +gcolor => "#ffffff") ' print $q->start_html(-'title', 'The Time', -'bgcolor', '#ffffff'); -e syntax OK $ perl -MO=Deparse -e 'print -"asdf"' print '-asdf'; -e syntax OK $ perl -MO=Deparse -e 'print -"1asdf"' print -1; -e syntax OK $ perl -MO=Deparse -e 'print -"-1asdf"' print '+1asdf'; $ perl -MO=Deparse -e 'print -"+1asdf"' print '-1asdf'; -e syntax OK
What I glean from this is that if you use unary minus on any non-numish-looking string constant, the minus will get prepended. If you use an undecorated(+/-) numish string constant it gets numified, but if you use a decorated one it inverts the sign and doesn't numify?
Is this accurate?
Is this documented anywhere?
What is the rule on this?
And what is this useful for (beyond use given in the OP)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: " - " in the syntax
by puudeli (Pilgrim) on Mar 06, 2009 at 06:04 UTC | |
by Anonymous Monk on Mar 06, 2009 at 09:27 UTC | |
by Anonymous Monk on Mar 06, 2009 at 09:27 UTC |