You certainly have a good point from a parsing
perspective, and this is likely where most of the implementation
issues arise. Still, this limitation is really not all
that different from the way Perl treats $AUTOLOAD type
function calls. You
have to be careful to adjoin the function name with brackets,
because the compiler isn't astute enough to find the function
reference, instead assuming there is a
bare word
in your code, and whining accordingly. Here's how
the compiler appears to behave when finding functions to
AUTOLOAD:
Func($x) -> &Func($x) OK
Func ($x) -> 'Func' ($x) !?!?
So, presumably, the same thing would apply to the parsing
of curly braces, in theory:
foo $bar{$baz} -> &foo($bar{$baz})
foo $bar {$baz} -> &foo($bar,sub {$baz})
I discovered this trying to eliminate the requirement for
'my ($self) = @_' having to be in every function for an
OO program by writing a wrapper which did it for you.
For whatever reason, you can't operate on a named sub.
Oh well.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.