Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Perl 5 interpreter

by Anonyrnous Monk (Hermit)
on Jan 12, 2011 at 08:35 UTC ( #881840=note: print w/replies, xml ) Need Help??

in reply to Perl 5 interpreter

Then again, as a last resort, there's always the compiler's -E option — to spit out the fully expanded C code instead of producing an object file.  (But be sure to run the compiler command with the otherwise same options that it would be run during a normal build, in order to get the correct results.)

For example, from gcc's man page:

-E Stop after the preprocessing stage; do not run the compiler pr +oper. The output is in the form of preprocessed source code, which is sent to the standard out +put.

Replies are listed 'Best First'.
Re^2: Perl 5 interpreter
by Anonymous Monk on Jan 12, 2011 at 08:49 UTC

    That throws text like this for example

    (void)( { while (PL_curstack != PL_mainstack) { Perl_dounwind(-1); + (void)( { SV **sp = PL_stack_sp; PERL_SI * const prev = PL_curstacki +nfo->si_prev; if (!prev) { fprintf((PL_stderrgv && (((svtype)((PL_std +errgv)->sv_flags & 0xff)) == SVt_PVGV) && (((PL_stderrgv)->sv_u.svu_g +p)->gp_io) && ((XPVIO*) ((((PL_stderrgv)->sv_u.svu_gp)->gp_io))->sv_a +ny)->xio_ofp ? ((XPVIO*) ((((PL_stderrgv)->sv_u.svu_gp)->gp_io))->sv_ +any)->xio_ofp : stderr), "panic: POPSTACK\n"); Perl_my_exit(1); } (vo +id)( { ((XPVAV*) (PL_curstack)->sv_any)->xav_fill = sp - PL_stack_bas +e; PL_stack_base = ((prev->si_stack)->sv_u.svu_array); PL_stack_max = + PL_stack_base + ((XPVAV*) (prev->si_stack)->sv_any)->xav_max; sp = P +L_stack_sp = PL_stack_base + ((XPVAV*) (prev->si_stack)->sv_any)->xav +_fill; PL_curstack = prev->si_stack; } ); PL_curstackinfo = prev; } ) +; } } );

    That is unreadable

      Which is why Perl programmers use macros, to hide the complexity.

      I guess this is code from the preamble to an XS sub that marks the Perl stack, or maybe code from the end of an XS sub that restores the previous stack state. If you show the original macros, it's maybe easier to explain.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://881840]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2018-03-20 00:55 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (247 votes). Check out past polls.