Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm confused, I thought this would work
without having to type parens like$ perl -MData::Dump -e " sub ff($$){ qq{@_} } my %f = ( 12 => ff 1,2, +34 => ff 3,4 ); dd\%f " Too many arguments for main::ff at -e line 1, near "4 )" Execution of -e aborted due to compilation errors.
$ perl -MData::Dump -e " sub ff($$){ qq{@_} } my %f = ( 12 => ff( 1,2) + , 34 => ff( 3,4) ); dd\%f " { 12 => "1 2", 34 => "3 4" }
A prototype of ($) doesn't require parens ... anyone?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: prototypes parens/parenthesis hash initialization/declaration / Too many arguments for / $$
by choroba (Cardinal) on Feb 12, 2013 at 09:48 UTC | |
by Anonymous Monk on Feb 12, 2013 at 09:52 UTC | |
|
Re: prototypes parens/parenthesis hash initialization/declaration / Too many arguments for / $$
by AnomalousMonk (Archbishop) on Feb 12, 2013 at 18:12 UTC | |
|
Re: prototypes parens/parenthesis hash initialization/declaration / Too many arguments for / $$
by kcott (Archbishop) on Feb 12, 2013 at 21:57 UTC |