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

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

Thread Previous | Thread Next
From:
Johan Vromans
Date:
January 7, 2014 09:04
Subject:
Re: [perl #120941] The => operator doesn't quote v-strings in "use constant v1 => 42"
Message ID:
m24n5gp3ho.fsf@phoenix.squirrel.nl
Brad Gilbert <b2gills@gmail.com> writes:

> I would expect that to be the equivalent to `use constant ('v1',1)`

Yes, but the syntax of 'use' is (perdoc -f):

  use Module VERSION LIST

and not

  use Module VERSION , LIST

(note the comma).

So in

  use Module X,Y,Z;

X,Y,Z is the LIST part, even if X resembles a version number. The
correct invocation for the latter is

  use Module X Y,Z;

-- Johan

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