469,366 Members | 2,229 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

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
Jun 18 '07 #1
8 23651
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....
Jun 20 '07 #2
KevinADC
4,059 Expert 2GB
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.
Jun 20 '07 #3
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

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.
Jun 26 '07 #4
KevinADC
4,059 Expert 2GB
I have no suggestions for hiding perl code.
Jun 26 '07 #5
alcazar
10
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




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
Jun 26 '07 #6
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.

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. use DBI;
  4. use strict;
  5. use lib '/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi';
  6. use Carp;
  7. use DynaLoader ();
  8. use Exporter ();
  9. my $drh = DBI->install_driver("mysql");
  10.  
  11.  
I hope it turns out to be of some help to future perl programmers who get into the same problem.

Ankit
Jul 3 '07 #7
Thank you Ankit for the post. Could you please let me know where i can get a free and reliable perl2exe?

Thanks in advance.
Sep 24 '10 #8
Hi,

Any issues with the downloaded version of this site?

http://www.indigostar.com/perl2exe.php#Download

The link was already mentioned above.
Sep 24 '10 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by mike | last post: by
4 posts views Thread by eight02645999 | last post: by
1 post views Thread by rajpar | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.