in reply to (5.6.1) map mayhem?
When Perl sees an open brace ({) that isn't part of some construct (like $hash{$key}), it sometimes isn't sure whether it is meant to start a block or an anonymous hash reference. You can tell Perl which you meant by using +{ for anonymous hash reference and {; for a block.
You are trying to pass a block to map so you can change the problematic line to:
which is a bit ugly. - tye$two->( map {; anda => $_ } @one );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: (5.6.1) map mayhem? (+{ {;)
by bart (Canon) on Oct 07, 2003 at 21:26 UTC | |
by merlyn (Sage) on Oct 07, 2003 at 21:42 UTC | |
by Abigail-II (Bishop) on Oct 08, 2003 at 11:24 UTC | |
by diotalevi (Canon) on Oct 08, 2003 at 01:03 UTC |