Perl Code Hiding

Is there a way to hide the Perl script like we do in C and other languages?
:rolleyes:

Hello,
Can you give more detail about "hiding" it? Do you not want the users to see the code, know the name of the perl script, etc?
You could compile the perl as opposed to running it via the interpreter or you could change the perms on the file or directory so users either can't read it or can't even see it. What OS are you on?
TioTony

exactly,
I just want to give the executable to others hiding the code from them.
I have not come across compiling a Perl script. I would like to know how I can do that.
I have always been running that.

changing permission would not probably do that I think. I am working on HP-Unix Ver 11.

Perl version 5

Wish you a Very Happy New Year!
:slight_smile:

Well, I'm no perl guru, but I know it IS possible to obfuscate the code enough that no one in their right mind could read it... for example:

#!/usr/bin/perl
@a=(Lbzjoftt,Inqbujfodf,
Hvcsjt); $b="Lbssz Wbmm"
;$b =~ y/b-z/a-z/ ; $c =
" Tif ". @a ." hsfbu wj"
."suvft pg b qsphsbnnfs"
. ":\n";$c =~y/b-y/a-z/;
print"\n\n$c ";for($i=0;
$i<@a; $i++) { $a[$i] =~
y/b-y/a-z/;if($a[$i]eq$a
[-1]){print"and $a[$i]."
;}else{ print"$a[$i], ";
}}print"\n\t\t--$b\n\n";

Try running that... Then try to figure it out...

There are a few ways to compile perl that I know of. It depends on your perl vendor in most cases so check with the vendor to see what you should do or check www.perlmonks.org.

perlcc will convert your perl to C so you can compile it with a C compiler.

http://www.perl2exe.com/ has a way to make perl scripts into stand alone executables.

perl -MO=C option works pretty well in perl 5. You'll probably want to read more about this.

I am sure there are more but you will have to do some digging to find them. Hopefully this will point you in the right direction. I have used the www.perl2exe.com stuff before and it works pretty well.

Thanks LivinFree and Tony, i got the perl2exe. it is working fine. but it takes a lot of space anyway.

:slight_smile:

and Guru!
the script is superb!!
but my bad, I'm not too brainy to do one like that!

Thanks again
:slight_smile: