in reply to Re: printing hashes
in thread printing hashes
Only scalars interpolate without some kind of bracketing.say "Array is @array[]"; say "Array is {@array}"; say "Hash is %hash{}"; say "Hash is {%hash}";
The space-separated form was chosen to make it easy to split on whitespace, but it's expected that most hash interpolations will in fact specify some more explicit format:
say "Hash is %hash.as('%s => %s', ', ')";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: printing hashes
by Zaxo (Archbishop) on May 07, 2005 at 01:54 UTC |