Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Perl_API get_sv and SvIV_set

by Util (Priest)
on Apr 17, 2006 at 02:10 UTC ( [id://543740]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl_API get_sv and SvIV_set
in thread Perl_API get_sv and SvIV_set

It sounds like you are looking for the opcode equivalent of the 'continue' statement. From a casual look at the differences in the output of these two commands:

perl -MO=Concise -e 'while ($z == 1) { $x=2;} continue {$y=3;}' perl -MO=Concise -e 'while ($z == 1) { $x=2;}'
I would guess that the opcode is 'pp_next'.

Replies are listed 'Best First'.
Re^4: Perl_API get_sv and SvIV_set
by BUU (Prior) on Apr 17, 2006 at 03:01 UTC
    Well, I modified pp_next by adding a "DIE" call in the middle of it but no loop I tried could trigger it. Doesn't seem to be the one I want.

      There is no such op. If you add a continue block, you'll notice that lineseq has three arguments/statements instead of just two. If you want to run something at the end of every loop, alter the optree to wire your op in.

      ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

        Heh. Not a bad idea if that is the only way to do it. Unfortunately I lack experience doing evil things to perl. Any idea on where I should be looking to do so? I understand perly.y has the grammar, or what there is of it, but I was a little confused how I could make it add an op.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-03-28 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found