Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: use constant usage clarification

by Loops (Curate)
on Oct 31, 2014 at 06:19 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-16 12:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found