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

Hi there, I am using the following command to compile my perl codes. perlcc -B -o "$filename" "$file" Which works wonderfully. The problem comes in when my programmes are attempting to do the work I have a file called globals.pl which requires Global_Socket.pl Program.pl requires globals.pl Now when all three are compiled I lose the values of some of the variables that are in globals.pl. As soon as Global_Socket.pl is not compiled those values arent lost. (This is a sample scenario, my real globals requires about 8 different files) Does anyone know how to get around this? Or for me to be able to compile all files and make sure that they all work. Thanks in advance

Replies are listed 'Best First'.
Re: perl compiling not working
by dirving (Friar) on Aug 07, 2008 at 05:53 UTC

    perlcc is no longer distributed with perl as of version 5.10, and in my understanding never worked particularly well in the first place. Depending on what you are trying to do, you may have more success using pp from the PAR distribution. Note that pp doesn't actually compile perl to machine code like perlcc does -- it just packs the perl interpreter with your script and all of its modules to create a stand-alone binary.

    -- David Irving
Re: perl compiling not working
by marto (Cardinal) on Aug 07, 2008 at 08:58 UTC
Re: perl compiling not working
by rurban (Scribe) on Aug 07, 2008 at 14:26 UTC
    The test results for B::Bytecode, the bytecode compiler backend for perlcc, show a that most perl versions from 5.8 to 5.11 fail on the same tests: 7 9-12 with threads enabled. Without threads and 5.8 the results are much better.

    The failing tests involve anonymous subs, split and index.
    See http://cpantesters.perl.org/show/B-C.html#B-C-1.04_20
    See also http://search.cpan.org/src/RURBAN/B-C-1.04_20/STATUS

    If you could send me a tar of your files I could make better recommendations.

    rurban - the perl compiler maintainer