Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Perl bytecode on unix

by LD2 (Curate)
on Mar 16, 2001 at 11:23 UTC ( [id://64923]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Perl bytecode on unix

fpi, to answer your first question.. you can use:
  • 1. ByteLoader module
  • 2. byteload_fh(FILEHANDLE) that is included with the B module
Which it seems like you're familiar with both of these ways...

From the looks of the second question, you're using ByteLoader correctly. Remember that it's still in experimental phase.. which would explain why it's a bit unstable. I believe there is an updated version coming out.

I believe you need to do a full compile(perlcc) to include other scripts that you used in your main script. If you run perlcc with the -b flag, it will generate bytecode instead of C code.. i.e. perlcc -b helloworld.pl

Here are a few good links:

Replies are listed 'Best First'.
Re: Perl bytecode on unix
by fpi (Monk) on Mar 16, 2001 at 18:47 UTC
    LD2, thanks for the post. After reading through the links you posted and then further testing, here's the first little interesting thing I found:

    perl -MO=Bytecode,-omyfile.bc myfile.pl produces the bytecode file, as before

    perlcc -b -o myfile.bc myfile.pl produces the bytecode, and automatically sticks in the perl header and use Byteloader 0.03; statement. The only problem was the perl header pointed to /perl instead of /usr/bin/perl, so I had to go in and edit anyway. But at least now I know that I was using the ByteLoader module correctly, since that was the way that perlcc sets it up.

    Thanks for the filehandle links too. I'm trying to experiment with byteloader_fh() again, but I'm getting "Undefined subroutine B::byteload_fh" errors. I reloaded the B modules....I just found out that you can't reload the B modules without reloading all of perl....

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://64923]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.