LanX has asked for the wisdom of the Perl Monks concerning the following question:
Does it make sense that
do ($foo)->{bar}
is parsed like
do ($foo ->{bar} )
instead of
(do $foo )->{bar}
or is it rather a bug?
Please compare how different
eval ($foo)->{bar}
gets parsed (see Re^2: B::Deparse weirdness (parser weirdness!) )
I understand that "Only Perl can parse Perl" but I think in order to secure the future of the language we should find ways to fix such inconsistencies.
Think about the problems for projects like Perlito or PPI.
Maybe more a meditation, hoping for more insights and a productive discussion.
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Are there more built-ins like this?
Do they qualify as unary operator (that's the way B::Deparse) tries to handle them.)
Isn't the precedence of unop well defined?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: parser bug handling 'do ($foo)->{bar}' ?
by Eily (Monsignor) on Oct 14, 2014 at 14:02 UTC | |
by LanX (Saint) on Oct 14, 2014 at 14:12 UTC | |
by Eily (Monsignor) on Oct 14, 2014 at 14:54 UTC | |
by LanX (Saint) on Oct 14, 2014 at 15:00 UTC | |
by LanX (Saint) on Oct 14, 2014 at 15:34 UTC | |
by Eily (Monsignor) on Oct 14, 2014 at 15:56 UTC | |
|