Re: Interpolating hash
* Shmuel wrote in comp.lang.perl.misc:
>I would like to produce a message that includes the value of a hash.
>Perl does not recognize a % sigil inside of quoted strings. I recall
>that there is syntax that causes interpolation of an expression, but
>haven't been able to find it in the documentation. Is there a clean
>way to do this, or should I just piece the text together with the
>concatenation operator, or interpolate an intermediate variable? Of
>the available techniques, which is considered to be the best style?
You do not need `%` to refer to a value in a hash in Perl5,
my %hash = ('key' => 'value');
would print `value`.
Björn Höhrmann · mailto:email@example.com · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
|All times are GMT. The time now is 10:20 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.