method interpolation

Dirk Koopman djk at
Wed Feb 1 12:59:53 GMT 2006

My brain is failing me. Is there some incantation (probably including
{}) that allows one to do something like: 

print "This is $syiq->UNIQID";

where UNIQID is a method that will (in this case) return an integer
giving the result: 

"This is 23" 

without doing: 

print "This is " . $syiq->UNIQID;

And if not, why not, seeing as:

my $syiq = {UNIQID => 23};
print "This is $syiq->{UNIQID}";

would print the result I require. 
Dirk Koopman <djk at>

More information about the mailing list