How to compile Perl script to Win32 dll?

K

Koms Bomb

Seems perlcc can only compile to .exe.
Any tool(freeware is good) to compile Perl script to Win32 dll?
I've googled and get something like PerlBin, etc, but they can't work for
me.
 
M

Matt Garrish

Koms Bomb said:
It's not attractive to me. It's commercial software, not free.
I didn't use any ActiveState's product.
The Perl I use is come with Apache 2.0, for Win32.
They are all free.

If you want free you're on the wrong platform... : )

You could write a dll in c++ and embed your perl code in it. You'll probably
have more luck finding a free tool to convert c code than one that will
build your perl code directly into a dll. (There's also PerlNet for visual
studio, but that again costs lots of $$$.)

Matt
 
K

Koms Bomb

If you want free you're on the wrong platform... : )

At least I think the tools for Perl should be free. :)
You could write a dll in c++ and embed your perl code in it. You'll probably
have more luck finding a free tool to convert c code than one that will
build your perl code directly into a dll. (There's also PerlNet for visual
studio, but that again costs lots of $$$.)

I don't want to use Perl VM to run Perl script.
What I want to do is to compile Perl script to binary code, so it makes
crackers who want to reverse engine my program very difficult to know the
program work flow because Perl compiler will insert many 'garbage' code
in the binary. AFAIR, perlcc generate more than 40K(or 60K) binary exe
for a ' print "hello world"; ' :)
If I put some critical code in Perl script and compile them to binary mode,
crackers will feel very headache.

But it doesn't matter for me not to use Perl script. I can make very complex
assembly code by myself. :)

Thank you for your help.
 
C

ChrisO

Koms said:
It's not attractive to me. It's commercial software, not free.
I didn't use any ActiveState's product.
The Perl I use is come with Apache 2.0, for Win32.
They are all free.
Overall, I don't know how you couldn't consider the basic ASPN Perl
installer "free"...??? That doesn't answer your question about
compiling a Perl script to a Win32 DLL (a solution for which you aren't
going to find IMO), but I can hardly see the AS Perl install as anything
more than free, myself, which is pretty stinking good on the Windows
platform (which seems to always cyphon $$$).

-ceo
 
K

Koms Bomb

Overall, I don't know how you couldn't consider the basic ASPN Perl
installer "free"...??? That doesn't answer your question about
compiling a Perl script to a Win32 DLL (a solution for which you aren't
going to find IMO), but I can hardly see the AS Perl install as anything
more than free, myself, which is pretty stinking good on the Windows
platform (which seems to always cyphon $$$).

Is that true?
http://www.activestate.com/Products/ASPN_Perl/
Seems we can only download ASPN Perl for evaluate. To use its full
functions, we should order it.
And even it's really free, I still prefer to Apache Perl rather than ASPN
Perl
because the purpose I use Perl is, 1, write small tools to parse text,
2, write CGIs, 3, anti-crack if possible. For the second reason, I'd like my
script
can work on each platform, not only Win32. I've heard ASPN Perl mainly for
Win32, so I don't prefer it.
Apache + Perl is my best love. :)
 
A

A. Sinan Unur

Is that true?
http://www.activestate.com/Products/ASPN_Perl/
Seems we can only download ASPN Perl for evaluate. To use its full
functions, we should order it.

You are confused between ASPN Perl and ActivePerl. See:

http://www.activestate.com/Products/ActivePerl/

and compare it to the information found at

http://www.activestate.com/Products/ASPN_Perl/

And even it's really free, I still prefer to Apache Perl

What is Apache Perl?
rather than ASPN Perl because the purpose I use Perl is, 1,
write small tools to parse text, 2, write CGIs, 3, anti-crack if
possible.

How you obtain and install Perl has no bearing on how you use it.
For the second reason, I'd like my script can work on each
platform, not only Win32. I've heard ASPN Perl mainly for Win32,
so I don't prefer it.

The distribution you install has no bearing on these issues either. It is
a matter of what modules and language features you use. For example,
which one of the following would you use?

my $fullpath = "$dir/$file";

or

my $fullpath = File::Spec->catfile($dir, $file);

Sinan.
 
A

A. Sinan Unur

What I want to do is to compile Perl script to binary code, so it
makes crackers who want to reverse engine my program very difficult to
know the program work flow because Perl compiler will insert many
'garbage' code in the binary. AFAIR, perlcc generate more than 40K(or
60K) binary exe for a ' print "hello world"; ' :)
If I put some critical code in Perl script and compile them to binary
mode, crackers will feel very headache.

Please read

perldoc -q hide

Sinan.
 
M

Matt Garrish

A. Sinan Unur said:
What is Apache Perl?

I believe he means Indigo Perl. It's the only distro on Windows I'm aware of
that also installs an Apache server. I can see how it might get confusing to
understand that Perl is Perl because of the "brand name" Perls that are
available for Windows.

Matt
 
A

A. Sinan Unur

I believe he means Indigo Perl.

OK. Thanks for the explanation.
I can see how it might get confusing to understand that
Perl is Perl because of the "brand name" Perls that are
available for Windows.

I have chosen to stay away from bundles. One of these days I am going to
succeed in compiling Perl from sources using the free MSVC command line
compiler. :)
 
K

Koms Bomb

Please read
perldoc -q hide

I want not only hide the source code but also
make the program more complexe. :)

However, Perl is not the only choice for me on this side,
I have other approach.
 
K

Koms Bomb

You are confused between ASPN Perl and ActivePerl. See:

Thank you for explaining that.
I've just download a copy of ActivePerl(so sick, I have to register,
I hate that).
Seems it's no better than my Apache/Perl, perlcc will
cause exception too(as Apache/Perl) when compile a simple
script that use Tk.
What is Apache Perl?

http://www.cpan.org/ports/index.html#win32
There are several package under Win32, I prefer the second one,
"Apache/Perl (binaries for both Perl-5.6/Apache-1.0/mod_perl-1 and
Perl-5.8/Apache-2/mod_perl-2) "

Which kind of Perl do you prefer under Win32? Only ActivePerl?

How you obtain and install Perl has no bearing on how you use it.

But I think Perl(and other script, Python, eg) 'should' be platform
independent.
I heard ActivePerl also support ActiveX, oh, that sounds not good
because I'll never use ActiveX in a Perl script.
The distribution you install has no bearing on these issues either. It is
a matter of what modules and language features you use. For example,

I know, but Apache/Perl is more platform independent. :)
 
K

Koms Bomb

I believe he means Indigo Perl. It's the only distro on Windows I'm aware
of
that also installs an Apache server. I can see how it might get confusing to
understand that Perl is Perl because of the "brand name" Perls that are
available for Windows.

Sorry, I didn't know what's Indigo Perl until I read what you said. :)
I've explained what's Apache Perl in my previous message that reply to
A. Sinan.
 
A

A. Sinan Unur

Thank you for explaining that.
I've just download a copy of ActivePerl(so sick, I have to register,
I hate that).

From http://www.activestate.com/Products/Download/Register.plex?
id=ActivePerl:

Contact info is not required to download.

What part of that do you not understand?
Seems it's no better than my Apache/Perl, perlcc will
cause exception too(as Apache/Perl) when compile a simple
script that use Tk.

Perl is Perl. Why should it be any different?
http://www.cpan.org/ports/index.html#win32
There are several package under Win32, I prefer the second one,
"Apache/Perl (binaries for both Perl-5.6/Apache-1.0/mod_perl-1 and
Perl-5.8/Apache-2/mod_perl-2) "

OK. Did not know Apache distributed such a bundle.
Which kind of Perl do you prefer under Win32? Only ActivePerl?

It is not a 'kind' of Perl. Perl is Perl. All of those are just
installation packages.

In any case, I started with ActivePerl and stayed with it. At some point,
the Cygwin installer went ahead and grabbed the Cygwin package as well. So
I have two versions on my hard drive, but httpd is configured to use
mod_perl2 with Active Perl.
But I think Perl(and other script, Python, eg) 'should' be platform
independent.

I fail to see the relevance.
I heard ActivePerl also support ActiveX, oh, that sounds not good
because I'll never use ActiveX in a Perl script.

I fail to see any possible way in which the statement above can make sense
(especially since you started this thread in your quest to compile a
Windows DLL from your Perl script).

I know, but Apache/Perl is more platform independent. :)

Please read

perldoc perlport

Whose Perl distribution you use has no bearing whatsoever on the
portability of your script.

Please put a space after those dashes:
http://www.gnus.org/manual/gnus_106.html
 
K

Koms Bomb

From http://www.activestate.com/Products/Download/Register.plex?
id=ActivePerl:

Contact info is not required to download.

What part of that do you not understand?

Sorry. I didn't notice that.
Perl is Perl. Why should it be any different?

Same Perl.exe, same bugs. :-(
It is not a 'kind' of Perl. Perl is Perl. All of those are just
installation packages.

I see. Maybe I should say which kind of installation package.
I fail to see any possible way in which the statement above can make sense
(especially since you started this thread in your quest to compile a
Windows DLL from your Perl script).

Yes, compiling to binary code has become platform dependent.
But I'm going to write some CGIs too, so platform independent is
important because I don't hope a script can run on Win32 but can't
run on *nix.
Especially I'm newbie to Perl, and I don't know clearly which part can be
platform
independent and which part can't. I'll study more.
Please put a space after those dashes:
http://www.gnus.org/manual/gnus_106.html

Sorry, I can't understand that, my English is too bad.
My signature is same in all my posts. I'm active in several different
kind of newsgroups, like shareware, tasm, perl, etc. So maybe GNU can't be
everything. :)
 
A

A. Sinan Unur

Sorry, I can't understand that, my English is too bad.
My signature is same in all my posts. I'm active in several different
kind of newsgroups, like shareware, tasm, perl, etc. So maybe GNU
can't be everything. :)

It has nothing to do with GNU. That page had a concise explanation of the
proper format of the signature separator which is a line that consists of
two dashes followed by a space. You may want to read:

http://mailformat.dan.info/trailers/sigblocks.html

Using a proper signature allows your signature block to be automatically
excluded from replies to your messages.

You may consider it trivial but it is useful nevertheless.
 
K

Koms Bomb

It has nothing to do with GNU. That page had a concise explanation of the
proper format of the signature separator which is a line that consists of
two dashes followed by a space. You may want to read:

http://mailformat.dan.info/trailers/sigblocks.html

Using a proper signature allows your signature block to be automatically
excluded from replies to your messages.

You may consider it trivial but it is useful nevertheless.

I see. I'm glad to do that if it's useful to others.
I didn't add that two dashes. They are added by Outlook Express.
Now I've added two dashes and a space by hand, but now I have
to remove the one that automatically added by OE by hand. :-(
Is it OK now?
I was looking for a better free newsgroup reader for long time.
If you can give me any advice, I'll appreciate.
Sorry, this post has been off topic.
 
A

A. Sinan Unur

I see. I'm glad to do that if it's useful to others.

Thank you. I apologize for nitpicking like this but you had the two
dashes and were missing just a single solitary space character so I could
not resist.
I didn't add that two dashes. They are added by Outlook Express.
....

Is it OK now?

Unfortunately, no.
I was looking for a better free newsgroup reader for long time.

XNews will be a definite improvement over OE.

http://xnews.newsguy.com/
 
J

Johnny \Gandalf\ Brasseur

Koms said:
Seems perlcc can only compile to .exe.
Any tool(freeware is good) to compile Perl script to Win32 dll?
I've googled and get something like PerlBin, etc, but they can't work for
me.

I think it could be a smart idea i think building a C wrapper which calls
perl functions if that's the idea.
If you're familiar with C there's an issue too using XS modules (not easy).
That could be free using either gcc(cygwin) or BorlandC++ or either win32
free compilers (there are others).
As i can remember , there's a C function called DllEntryPoint which takes
several WIN32 parameters which are to be used for initing or resigning the
use of this dll... hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top