How to compile perl code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ankitmathur
    New Member
    • May 2007
    • 36

    How to compile perl code

    Hi Everybody,

    I am new to perl so am asking you all a very basic question.

    Do we get to have a compiled file in perl just like java?

    What I mean is whether we get to have a compiled file for our .PL files like we get to have .CLASS compiled files in JAVA.

    If yes, I'd appreciate if somebody could guide me about how to get it. I have a .PL file which is running smoothly but to make sure of its portability & hiding the code I want to know if something like a compiled file is also there.


    Thanks
    Ankit
  • digitalpbk
    New Member
    • Jun 2007
    • 4

    #2
    I dont think PERL can be compiled. There are some programs that convert PERL scripts to EXE's. Other than that to me PERL is an interpreter.

    perl scipt.pl
    ./script.pl (on *nix with #! /usr/bin/perl on top and proper permissions)

    would get it running....

    Comment

    • KevinADC
      Recognized Expert Specialist
      • Jan 2007
      • 4092

      #3
      Perl scripts are interpreted by perl. There are no complied files like Java or C. the perl interpreter converts perl scripts into bytecode, then does some more stuff I'm not totally sure of, then runs the code.

      Comment

      • ankitmathur
        New Member
        • May 2007
        • 36

        #4
        Ya agreed. Its only an interpreter. But I need to do something to hide my code so that the source code is not freely available when my application is distributed. I do know that even compiled files can be converted back but atleast it may act as a deterrent.

        I tried using perlcc & perl2exe. But both seem to be stucking somewhere or, the other with no great solutions available even from google.

        My plain-jane perl script works perfectly fine but I need to find a security cover to it.

        Any ideas for hiding the code except perlcc & perl2exe ???

        I'm using perl on a *nix machine.

        Thanks
        Ankit

        Originally posted by KevinADC
        Perl scripts are interpreted by perl. There are no complied files like Java or C. the perl interpreter converts perl scripts into bytecode, then does some more stuff I'm not totally sure of, then runs the code.

        Comment

        • KevinADC
          Recognized Expert Specialist
          • Jan 2007
          • 4092

          #5
          I have no suggestions for hiding perl code.

          Comment

          • alcazar
            New Member
            • Jun 2007
            • 10

            #6
            You might want to have a look at this link.It has got different versions of perl to exe converters.

            http://www.indigostar. com/perl2exe.htm




            Originally posted by ankitmathur
            Ya agreed. Its only an interpreter. But I need to do something to hide my code so that the source code is not freely available when my application is distributed. I do know that even compiled files can be converted back but atleast it may act as a deterrent.

            I tried using perlcc & perl2exe. But both seem to be stucking somewhere or, the other with no great solutions available even from google.

            My plain-jane perl script works perfectly fine but I need to find a security cover to it.

            Any ideas for hiding the code except perlcc & perl2exe ???

            I'm using perl on a *nix machine.

            Thanks
            Ankit

            Comment

            • ankitmathur
              New Member
              • May 2007
              • 36

              #7
              Hi Friends,

              Just to update on this problem. I've been able to successfully get the desired output file from perl2exe.

              The solution I tried was to give additional path in my perl program as to enable perl2exe also use my default perl as distributed with linux installation.

              So any missing components I believe were taken care of by the default perl path.

              Code:
               
               
              use DBI;
              use strict;
              use lib '/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi';
              use Carp;
              use DynaLoader ();
              use Exporter ();
              my $drh = DBI->install_driver("mysql");
              I hope it turns out to be of some help to future perl programmers who get into the same problem.

              Ankit

              Comment

              • nerellav
                New Member
                • Sep 2010
                • 1

                #8
                Thank you Ankit for the post. Could you please let me know where i can get a free and reliable perl2exe?

                Thanks in advance.

                Comment

                • ankitmathur
                  New Member
                  • May 2007
                  • 36

                  #9
                  Download link

                  Hi,

                  Any issues with the downloaded version of this site?



                  The link was already mentioned above.

                  Comment

                  Working...