Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: my within brackets

by LanX (Sage)
on Oct 14, 2021 at 23:29 UTC ( #11137559=note: print w/replies, xml ) Need Help??


in reply to Re^2: my within brackets
in thread my within brackets

B::Deparse is occasionally wrong, it has to guess which code was optimized to what it finally sees.

But the op-tree is more reliable

D:\tmp\pm>perl -Mstrict -Mwarnings -MO=Concise my ($u, $v) = split /,/, 'U,V'; __END__ 9 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter v ->2 2 <;> nextstate(main 1 -:1) v:*,&,{,x*,x&,x$,$ ->3 8 <2> aassign[t4] vKS ->9 - <1> ex-list lK ->7 3 <0> pushmark s ->4 6 </> split(/","/)[t3] lK/IMPLIM ->7 4 <$> const[PV "U,V"] s ->5 5 <$> const[IV 3] s ->6 - <1> ex-list lKPRM* ->8 7 <0> padrange[$u:1,2; $v:1,2] RM/LVINTRO,range=2 ->8 - <0> padsv[$u:1,2] sRM*/LVINTRO ->- - <0> padsv[$v:1,2] sRM*/LVINTRO ->- - syntax OK D:\tmp\pm>perl -Mstrict -Mwarnings -MO=Concise (my $u, my $v) = split /,/, 'U,V'; __END__ 9 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter v ->2 2 <;> nextstate(main 1 -:1) v:*,&,{,x*,x&,x$,$ ->3 8 <2> aassign[t4] vKS ->9 - <1> ex-list lK ->7 3 <0> pushmark s ->4 6 </> split(/","/)[t3] lK/IMPLIM ->7 4 <$> const[PV "U,V"] s ->5 5 <$> const[IV 3] s ->6 - <1> ex-list lKPRM* ->8 7 <0> padrange[$u:1,2; $v:1,2] RM/LVINTRO,range=2 ->8 - <0> padsv[$u:1,2] sRM*/LVINTRO ->- - <0> padsv[$v:1,2] sRM*/LVINTRO ->- - syntax OK D:\tmp\pm>

Now, spot the difference! ;-)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^4: my within brackets
by ikegami (Patriarch) on Oct 15, 2021 at 13:48 UTC

    Now, spot the difference! ;-)

    $ diff -u \ <( perl -Mstrict -Mwarnings -MO=Concise -e'my ($u, $v) = split / +,/, "U,V";' 2>&1 ) \ <( perl -Mstrict -Mwarnings -MO=Concise -e'(my $u, my $v) = split / +,/, "U,V";' 2>&1 ) \ && echo same same

    PS, I usually use -MO=Concise,-exec

    1 <0> enter 2 <;> nextstate(main 1 -e:1) v:*,&,{,x*,x&,x$,$ 3 <0> pushmark s 4 <$> const[PV "U,V"] s 5 <$> const[IV 3] s 6 </> split(/","/)[t3] lK/IMPLIM 7 <0> padrange[$u:1,2; $v:1,2] RM/LVINTRO,range=2 8 <2> aassign[t4] vKS 9 <@> leave[1 ref] vKP/REFC -e syntax OK
      I though about diff, but I'm mostly on Win and was too lazy to fire up the VM for that ...

      But now I remembered gitbash ...

      MINGW64 ~ $ diff -u \ > <( perl -Mstrict -Mwarnings -MO=Concise -e'my ($u, $v) = split + /,/, "U,V";' 2>&1 ) \ > <( perl -Mstrict -Mwarnings -MO=Concise -e'(my $u, my $v) = split + /,/, "U,V";' 2>&1 ) \ > && echo same same

      thanks! :)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

      ) and I firmly expected someone would do it for me anyway ;-)

        I purchased a license of Beyond Compare many years back. I've used it *a lot*

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11137559]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2022-05-24 12:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (82 votes). Check out past polls.

    Notices?