in reply to Re: version string oddities
in thread version string oddities

Note that v-strings aren't required to demonstrate this oddity.

> perl -wle 'print -"abc"' -abc > perl -wle 'print -"/abc";' Argument "/abc" isn't numeric in negation (-) at -e line 1. -0

Which I first considered a bug in unary minus (thinking it should only act this way on bare words), but I think it is a reasonable choice if it is intentional and documented (it just isn't how I had the feature explained to me).

- tye        

Replies are listed 'Best First'.
Re^3: version string oddities (-bug)
by chrisdolan (Beadle) on Sep 24, 2006 at 05:06 UTC
    Hmm, check this out:
    % perl -le'print -"-aaa"' +aaa % perl -le'print -"+aaa"' -aaa
    That's highly unexpected to me.
      Looks like you don't even need the quotes:
      $ perl -le 'print -aaa' -aaa $ perl -le 'print -+-aaa' +aaa
      You can't put "--aaa" because Perl thinks it's a decrement.
      "If you go on with this nuclear arms race, all you are going to do is make the rubble bounce" -- Winston Churchill