in reply to Puzzling $| behavior
| ...
| XPUSH( "\n" );
| XPUSH( $| );
| $|--; # plus true/false magic
| XPUSH( "second=" );
| XPUSH( $| );
| XPUSH( "first=" );
| PUTBACK;
| call_pv("print", G_ARRAY);
| ...
| (please correct here me if I'm wrong)the important output will be:1: $| = 1; 2: print "first=", $|, " second=", $|--, "\n";
from where it can be learned that the $| decrementOP (0x824de58) enter COP (0x81f3290) nextstate #1 $| = 1 SVOP (0x824dc80) const [6] IV (0x8167cdc) 1 PADOP (0x818ae48) gvsv GV (0x8168894) *| BINOP (0x8189398) sassign # COP (0x824c638) nextstate OP (0x8250178) pushmark # 2 SVOP (0x8189428) const [7] PV (0x816881c) "first=" PADOP (0x818c6f0) gvsv GV (0x8168894) *| SVOP (0x818de00) const [8] PV (0x8168828) " second=" PADOP (0x824ff88) gvsv GV (0x8168894) *| UNOP (0x824fe50) postdec [4] SVOP (0x824de38) const [9] PV (0x81688b8) "\n" LISTOP (0x8250150) print # LISTOP (0x824dac0) leave [1]
/1/ perl -MO=Bblock mysource.pl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Puzzling $| behavior
by blokhead (Monsignor) on Oct 08, 2007 at 05:23 UTC | |
by ikegami (Patriarch) on Oct 08, 2007 at 05:54 UTC | |
by mwah (Hermit) on Oct 08, 2007 at 10:35 UTC | |
by oha (Friar) on Oct 08, 2007 at 12:34 UTC | |
by ikegami (Patriarch) on Oct 08, 2007 at 16:58 UTC |