The stuff perl is compiled into is called an optree. This is a graph of C structs generally pointing down but with some "up" pointers added for efficiency. I suppose you could serialize the memory to disk but you couldn't just reconstitute it by copying it back into memory. You could invent an abstract serialization for this data like YAML, XML, Lisp, something text based, or something binary. B::Bytecode is one choice that just invented its own format. It's a binary thing and it isn't really related to the in-memory stuff that perl executes. You could dump a program with B::Debug and reconstitute it from that. I don't think anyone wrote a perl->YAML conversion. There's at least two perl->XML conversions, one by TimToady and another by chromatic. I wrote a perl->Lisp in B::Lisp but removed it from CPAN when I decided to abandon it. In all cases the bytecode, YAML, XML, text and Lisp formats are all equally close to perl's own representation which is to say, very far from it.

Systems that actually use bytecode don't treat their program at all like perl. There's a real stream of binary instructions perhaps just like might be used by your computer's CPU. A bytecode "add" instruction might be the byte 0x31. Perl's add instruction is a pointer to the C function pp_add. This doesn't mean a thing as far as performance, AFAIK, but I think it means that bytecode systems get a cheap serialization - just dump the bytecode while optree systems don't.

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊


In reply to Re^6: encrypting perl code used with mod_perl by diotalevi
in thread encrypting perl code used with mod_perl by moshkod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.