in reply to Re^2: parser bug handling 'do ($foo)->{bar}' ?
in thread parser bug handling 'do ($foo)->{bar}' ?

My answer starts by "I guess", so you have to take it for what it is. do FILE; is kinda like goto FILE; except it works. Like goto, do has two different meanings depending on the syntax, and the flow-control side means the keywords are not parsed like most other.

Edit: I'm not saying that do is always flow control, but that since it may be, the parser deals with it differently

  • Comment on Re^3: parser bug handling 'do ($foo)->{bar}' ?

Replies are listed 'Best First'.
Re^4: parser bug handling 'do ($foo)->{bar}' ?
by LanX (Saint) on Oct 14, 2014 at 15:00 UTC
    We all are only guessing. ;)

    But asking enough questions might eventually lead to an answer! =)

    Never (modulo Alzheimer) heard of the "looks like function rule" , but Deparse mentions it.

    Grateful for deeper insight!

    Cheers a questioning mind

    (addicted to the Perl Programming Language and ☆☆☆☆ :)

Re^4: parser bug handling 'do ($foo)->{bar}' ?
by LanX (Saint) on Oct 14, 2014 at 15:34 UTC
    > Edit: I'm not saying that do is always flow control, but that since it may be, the parser deals with it differently

    From do EXPR

    Uses the value of EXPR as a filename and executes the contents of the file as a Perl script. do 'stat.pl'; is largely like eval `cat stat.pl`;

    hope you understand now why I have problems to see the diff to eval regarding flow control.

    Cheers Rolf

    (addicted to the Perl Programming Language and ☆☆☆☆ :)

      I do understand. I think too that it would be more intuitive for do EXPR; to be parsed as eval EXPR; but I'll sleep better for having an idea of where the difference comes from :).