http://www.perlmonks.org?node_id=78467

lindex has asked for the wisdom of the Perl Monks concerning the following question:

How do I run perl byte code from a scalar inline with my normal perl program?

I have looked into ByteLoader and it doesn't really provide any methods, all it wants todo is read bytecode to the end of my script file and add that inline.

... some perl code, it may even use stuff defined in byte code ... use ByteLoader; <byte code>

B is supposed to export a "byteload_fh" and a "byteload_string" method, but this seems to be untrue?

Any help would be great




lindex

2001-05-07 Edit by Corion : Fixed the title

Replies are listed 'Best First'.
Re (tilly) 1: ByteLoader is not enough ?
by tilly (Archbishop) on May 08, 2001 at 17:40 UTC
    I have not tried using B. But perldoc -m B shows that byteload_fh and byteload_string are in @EXPORT_OK. So you would need to do something like
    use B qw(byteload_string);
    to get that.

    UPDATE
    I am using Perl 5.005_03. But I doubt that this would have been changed in 5.6.x. In any case you can try that perldoc command and read the source-code for your version.

      What version of perl are you using?


      lindex