method interpolation

Aaron Crane perl at aaroncrane.co.uk
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 Interpolation.pm 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 london.pm mailing list