Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: use constant usage clarification

by Loops (Curate)
on Oct 31, 2014 at 06:19 UTC ( #1105699=note: print w/replies, xml ) Need Help??

in reply to use constant usage clarification

Hi perlron,

from the perlop page:
The => operator is a synonym for the comma except that it causes a word on its left to be interpreted as a string if it begins with a letter or underscore and is composed only of letters, digits and underscores. This includes operands that might otherwise be interpreted as operators, constants, single number v-strings or function calls. If in doubt about this behavior, the left operand can be quoted explicitly.

So there is no assignment going on (at that point), just a list of values being passed to the pragma. It's the same as this:

use constant 'x',  1/3;

The pragma then does the magic of turning each identifier,value pair into a usable constant.

Replies are listed 'Best First'.
Re^2: use constant usage clarification
by perlron (Pilgrim) on Oct 31, 2014 at 06:36 UTC

    Ok .thanks . nothing to worry for me about => then..

    The temporal difficulty with perl is u need to know C well to know the awesome.else u just keep *using* it and writing inefficient code

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1105699]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2022-05-16 09:57 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (62 votes). Check out past polls.