develooper Front page | perl.perl5.porters | Postings from January 2014

Re: [perl #120941] The => operator doesn't quote v-strings in "useconstant v1 => 42"

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
January 6, 2014 23:04
Subject:
Re: [perl #120941] The => operator doesn't quote v-strings in "useconstant v1 => 42"
Message ID:
CAHhgV8hFM0fXxkzEre2CMShyaCirMRBA6zp_jf09sKCeCwwT1A@mail.gmail.com
On Mon, Jan 6, 2014 at 5:50 PM, Zoffix Znet <perlbug-followup@perl.org>wrote:

> The fat comma operator (=>) doesn't seem to quote v-strings when used in
> the "use BLAH v1 => 42" lines. A particular example is "use constant v1
> => 42" The v1 should be quoted by the => operator, but that line of code
> produces a syntax error:   "syntax error at -e line 1, near "use
> constant v1 =>""
>

use optionally takes a version, so that is parsed as «use <module>
<version> <expression>», and => is not a valid start of an expression.

Leon

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About