Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Print the Global special constant Variable

by Anonyrnous Monk (Hermit)
on Feb 09, 2011 at 12:56 UTC ( #887186=note: print w/ replies, xml ) Need Help??


in reply to Print the Global special constant Variable

If you absolutely must interpolate the constant (I'm not sure why, and what's wrong with your first solution using concatenation...), you can say:

print "This is the package => ${\__PACKAGE__} <="; # or print "This is the package => @{[__PACKAGE__]} <=";

The idea is just to create a reference to whatever you want to interpolate, and then dereference it using the double-quote-interpolated sigils ${...} or @{...}.


Comment on Re: Print the Global special constant Variable
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2015-07-07 03:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls