method interpolation

Aaron Crane perl at
Fri Feb 3 14:35:42 GMT 2006

Dirk Koopman writes:
> Is there some incantation (probably including {}) that allows one to
> do something like: 
> print "This is $syiq->UNIQID";

One option is to use from CPAN:

  use Interpolation _ => 'identity';

  print "This is $_{$syiq->UNIQID}";

Slightly less ugly than the reference-interpolation trick, I think.

Aaron Crane

More information about the mailing list