in reply to When is a hashreference a subexpresion?
The interpreter will try its hardest depending on the context to guess what you mean, but in this instance you have to provide a hint to the interpreter to disambiguate the brace.
orsub a { +{ x } }
should do the trick. I forgot which perl doc I read this in. It think it was perlref, but I'm not sure.sub a { return { x } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: When in a hashreference a subexpresion?
by Anonymous Monk on Aug 09, 2006 at 08:13 UTC | |
by Jasper (Chaplain) on Aug 09, 2006 at 14:53 UTC |