On Tue Oct 12 11:58:29 2010, zefram@fysh.org wrote: > > This is a bug report for perl from zefram@fysh.org, > generated with the help of perlbug 1.36 running under perl 5.10.0. > > The determination of whether a "{" is the start of a block or a hash > constructor depends in part on looking for "=>" following an initial > bareword. This search gives up at end of line: > > $ perl -lwe '{ foo => 1 }->${\sub{ print @_ }}' > HASH(0x1e1edf0) > $ perl -lwe '{ foo '$'\n'' => 1 }->${\sub{ print @_ }}' > syntax error at -e line 2, near "}->" > Execution of -e aborted due to compilation errors. My subjective reaction to that last line of code is: "Whoever writes code that ugly gets what he deserves." > > It should really be willing to add the next line to the buffer, and do > a > full skipspace() job. Less subjectively, I feel we should ask: Do we really need this functionality? > However, because it's looking ahead of the > current > lexing point, there's some trickiness about restoring lexing state > back > to the "{". > Thank you very much. Jim Keenan --- via perlbug: queue: perl5 status: new https://rt.perl.org:443/rt3/Ticket/Display.html?id=78348