in reply to Re: Re: Surprising Syntax
in thread Surprising Syntax

That's not surprising at all, because that's exactly what => is supposed to do: autoquote its left hand side if the left hand side is a simple unquoted string.

TEST is a simple unquoted string, hence it gets quoted, and hence, it's not a constant.

Compare:

my %h = (time => 0); print keys %h;
That also prints the string time, and not a number.

You could always use +TEST or TEST(), as discussed in the manual page of constant.pm.

Abigail

Replies are listed 'Best First'.
Re: Re: Surprising Syntax
by strat (Canon) on Aug 13, 2002 at 12:54 UTC
    I agree. The surprise was just in the context that a v-string is not autoquoted. So in my eyes, the behaviour with the v-string is not the same as with constants (and other subs) which makes me think that the v-string behaviour really is a bug.

    Best regards,
    perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"

      The concensus on p5p seems to be that it's recognized as a bug. But to fix this (and some other v-string strangeness) isn't easy, as v-strings live on the point where the tokenizer, the parser and the magic system meet.

      It's where the dragons live.

      Abigail