in reply to Print the contents of a hash without looping.
One information which I forgot to add is that @{[...]} is a construct to tunnel Perl code into string interpolation.
This is handy if you don't have a template engine.
For instance
my $tmpl = << "__HTML__"; ... some HTML ... <h1>@{[ text ( en => "title", de => "Titel", ) ]}</h1> ... more HTML ... __HTML__
is code I actively use in a CGI where the sub text() decides which language to insert.
The code is executed in list context, that's why %hash get expanded to a list.
HTH!
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery
|
|---|