This is a question which can be broken up into several ones.

I'll start with what is perl, and what is Perl within perl.

perl is the Perl interpreter. It reads source code of the language Perl, and at the same go runs it. Compilation and runtime are fused into one process (kind of, but lets not get pesky), which is done over and over again.

C (and other compiled languages) is turned into machine language - something the actual processor/operating system understands.

In order to acheive what you want, you need to find a way to represent the code compiled into memory, by the interpreter, on disk, in a way that is understandable by the operating system. You can package the interpreter and the perl code into one binary executable using several development environments (i think the activestate suite supports something like that), or on unix, you can use CORE::dump, as documentat in perlfunc.

You can also do something with the various B:: modules, but i feel i have no right telling you about them, as i haven't the faintest clue how to use them.

The problem with running Perl without perl is that there are many dynamics between the two. It's hard to rethink of everything making a package, and thus the only natural way to do this is to include perl, and your Perl, in the same binary executable, in a way that the section which is perl reads data from the section which is your code, and runs it.

I hope i've shed a bit of light, and am sorry for the confusion that i may have caused. Currently and simply it's impossible to run a Perl program without perl installed, somehow. There are various ways of getting around this, but none involve ignoring this completely. The B:: namespace is your friend, in this case, i think.

Update: http://www.perldoc.com/perl5.8.0/bin/perlcc.html perldoc perlcc might be of use.

-nuffin
zz zZ Z Z #!perl

In reply to Re: Running perl in a system that doesnt have perl.......... by nothingmuch
in thread Running perl in a system that doesnt have perl.......... by Anonymous Monk

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.