Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Importing constans and variables when "require"ing

by Perlbotics (Bishop)
on Feb 22, 2019 at 21:58 UTC ( #1230430=note: print w/replies, xml ) Need Help??


in reply to Importing constans and variables when "require"ing

use const does it's trick by creating a sub that returns a then "constant" value. Use the function call parents to honour that fact in the context of the print statement at compile time.

print "CONST=" . XYZ::CONST() . "\n"; # ^^-here

Replies are listed 'Best First'.
Re^2: Importing constans and variables when "require"ing
by bliako (Monsignor) on Feb 22, 2019 at 22:53 UTC

    ok that's a neat trick

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (1)
As of 2022-05-19 03:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (71 votes). Check out past polls.

    Notices?