in reply to Anonymous array with qw() doesn't always work?
is equivalent to$x = { foo => 'bar', baz => qw( bax bof ) }
And that should give you a "odd number of elements" warning if you have warnings enabled.$x = { foo => 'bar', baz => 'bax', 'bof' }
You can do
to transform the list into an anonymous array and all will be fine.$x = { foo => 'bar', baz => [ qw( bax bof ) ] }
Update: removed nonsense new() calls.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Anonymous array with qw() doesn't always work?
by derby (Abbot) on Jun 13, 2007 at 14:37 UTC | |
by Joost (Canon) on Jun 13, 2007 at 14:57 UTC |