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

> 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 ☆☆☆☆ :)

Replies are listed 'Best First'.
Re^5: parser bug handling 'do ($foo)->{bar}' ?
by Eily (Monsignor) on Oct 14, 2014 at 15:56 UTC

    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 :).

        > But actually this helps fixing the bug in B::Deparse, cause the handling of other pseudofunctions could be mimicked for do FILE .

        or we're going to identify a whole new problem group ;´D

        $ perl -MO=Deparse -e '(-s "foo")+100' -s('foo') + 100; -e syntax OK $ perl -w -MO=Concise -e '(-s "foo")+100' Useless use of addition (+) in void context at -e line 1. 7 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v:{ ->3 6 <2> add[t2] vK/2 ->7 4 <1> ftsize[t1] sKP/1 ->5 3 <$> const[PV "foo"] s ->4 5 <$> const[IV 100] s ->6 -e syntax OK $ perl -w -MO=Concise -e '-s ("foo")+100' 7 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v:{ ->3 6 <1> ftsize[t2] vK/1 ->7 5 <2> add[t1] sK/2 ->6 3 <$> const[PVNV "foo"] sP ->4 4 <$> const[IV 100] s ->5 -e syntax OK

        Cheers Rolf

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

        perlglossary was imported from the Camel III (with permission) so sometimes has terminology differences from the rest of the perldoc.
        A math joke: r = | |csc(θ)|+|sec(θ)| |-| |csc(θ)|-|sec(θ)| |