Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 exploiting the Monastery: (2)
As of 2023-06-03 02:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (6 votes). Check out past polls.

    Notices?