http://qs321.pair.com?node_id=1230430


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