For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > July 2004 > How to compile Perl script to Win32 dll?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to compile Perl script to Win32 dll?
Koms Bomb

2004-07-20, 3:56 am

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.


--
Koms Bomb

*****Pardon my poor English*****
---------------------
My TASM homepage, resource for assembly. Tools, articles, links.
http://komsbomb.ols-lab.com


Matt Garrish

2004-07-20, 3:58 pm


"Koms Bomb" <komsbomb@hotmail.com> wrote in message
news:2m3t7iFimvufU1@uni-berlin.de...
> 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.
>


Have you had a look at perlctrl?

http://aspn.activestate.com/ASPN/do...lCtrl/What.html

Matt


Koms Bomb

2004-07-21, 3:56 am

> Have you had a look at perlctrl?
>
> http://aspn.activestate.com/ASPN/do...lCtrl/What.html


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.


--
Koms Bomb

*****Pardon my poor English*****
---------------------
My TASM homepage, resource for assembly. Tools, articles, links.
http://komsbomb.ols-lab.com


Matt Garrish

2004-07-21, 3:56 am


"Koms Bomb" <komsbomb@hotmail.com> wrote in message
news:2m60rqFjg85tU1@uni-berlin.de...
>
> 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


Koms Bomb

2004-07-21, 3:56 am

> 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.


--
Koms Bomb

*****Pardon my poor English*****
---------------------
My TASM homepage, resource for assembly. Tools, articles, links.
http://komsbomb.ols-lab.com


ChrisO

2004-07-21, 3:56 am

Koms Bomb wrote:
>
>
> 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
Koms Bomb

2004-07-21, 3:57 am

> 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. :-)


--
Koms Bomb

*****Pardon my poor English*****
---------------------
My TASM homepage, resource for assembly. Tools, articles, links.
http://komsbomb.ols-lab.com


A. Sinan Unur

2004-07-21, 8:59 am

"Koms Bomb" <komsbomb@hotmail.com> wrote in
news:2m6i85Fjp20rU1@uni-berlin.de:

>
> 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 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. Sinan Unur
1usa@llenroc.ude.invalid
(remove '.invalid' and reverse each component for email address)

A. Sinan Unur

2004-07-21, 8:59 am

"Koms Bomb" <komsbomb@hotmail.com> wrote in
news:2m664mFj7u9mU1@uni-berlin.de:

> 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.
--
A. Sinan Unur
1usa@llenroc.ude.invalid
(remove '.invalid' and reverse each component for email address)

Matt Garrish

2004-07-21, 3:57 pm


"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
news:Xns952D56F4740F8asu1cornelledu@132.236.56.8...
> "Koms Bomb" <komsbomb@hotmail.com> wrote in
> news:2m6i85Fjp20rU1@uni-berlin.de:
>
>
> 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. Sinan Unur

2004-07-21, 3:57 pm

"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in
news:sZtLc.21733$Vw3.1328899@news20.bellglobal.com:

>
> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
> news:Xns952D56F4740F8asu1cornelledu@132.236.56.8...
>
> 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. :)

--
A. Sinan Unur
1usa@llenroc.ude.invalid
(remove '.invalid' and reverse each component for email address)

Koms Bomb

2004-07-22, 3:56 am

> 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.


--
Koms Bomb

*****Pardon my poor English*****
---------------------
My TASM homepage, resource for assembly. Tools, articles, links.
http://komsbomb.ols-lab.com


Koms Bomb

2004-07-22, 3:56 am

> You are 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/


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. :-)


--
Koms Bomb

*****Pardon my poor English*****
---------------------
My TASM homepage, resource for assembly. Tools, articles, links.
http://komsbomb.ols-lab.com


Koms Bomb

2004-07-22, 3:56 am

> 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.


--
Koms Bomb

*****Pardon my poor English*****
---------------------
My TASM homepage, resource for assembly. Tools, articles, links.
http://komsbomb.ols-lab.com


A. Sinan Unur

2004-07-22, 3:56 am

"Koms Bomb" <komsbomb@hotmail.com> wrote in
news:2m8ld9Fk9cl9U1@uni-berlin.de:

>
> 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.../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


--
A. Sinan Unur
1usa@llenroc.ude.invalid
(remove '.invalid' and reverse each component for email address)

Koms Bomb

2004-07-22, 3:56 am

> From http://www.activestate.com/Products.../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. :-)


--
Koms Bomb

*****Pardon my poor English*****
---------------------
My TASM homepage, resource for assembly. Tools, articles, links.
http://komsbomb.ols-lab.com



A. Sinan Unur

2004-07-22, 3:56 am

"Koms Bomb" <komsbomb@hotmail.com> wrote in
news:2m8ncqFk6u1oU1@uni-berlin.de:

>
> 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.

--
A. Sinan Unur
1usa@llenroc.ude.invalid
(remove '.invalid' and reverse each component for email address)

Koms Bomb

2004-07-22, 3:56 am

> 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.

--
Koms Bomb

*****Pardon my poor English*****
---------------------
My TASM homepage, resource for assembly. Tools, articles, links.
http://komsbomb.ols-lab.com


Johnny \Gandalf\ Brasseur

2004-07-22, 8:56 pm

Koms Bomb wrote:

> 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.
> --
> Koms Bomb


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.

--
Johnny "gandalf" Brasseur (http://www.perlone.org/)

Koms Bomb

2004-07-23, 3:56 am

> 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.


I'm familiar with C and Win32 program.
Using Perl is an interesting approach, but not must. :-)
I'll use other method to do my project.


--
Koms Bomb

*****Pardon my poor English*****
---------------------
My TASM homepage, resource for assembly. Tools, articles, links.
http://komsbomb.ols-lab.com


Joe Smith

2004-07-23, 8:56 am

Koms Bomb wrote:

>
> 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) "


Following the links, I came to this documentation:

http://apache.bestwebcover.com/perl...in32-bin.readme

This is a binary distribution for Win32 of Perl 5.6.1 and apache 1.3.27,
together with mod_perl-1.27, mod_ssl / OpenSSL (0.9.7b),
and php-4.3.2, all built with VC++ 6.0 (SP5). Also included are some popular
non-core module packages such libnet, libwww-perl, Tk, and DBI.
Perl was built using the sources for build 635 provided by ActiveState.

http://apache.bestwebcover.com/perl...in32-bin.readme

This is a binary distribution for Win32 of Perl 5.8.4 and apache 2.0.50,
together with mod_perl-1.99, mod_ssl / OpenSSL (0.9.7d),
and php-4.3.7, all built with VC++ 6.0 (SP5). Also included are some popular
non-core module packages such libnet, libwww-perl, Tk, and DBI.
Perl was built using the sources for build 810 provided by ActiveState.

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


Your "Apache Perl" is really ActivePerl packaged differently.

If you're only using Perl for CGI programming, then there is no need
to compile it.
1) mod_perl already avoids the overhead of re-parsing the script.
2) web users cannot see your source code; it is hidden and only the
output from the script is visible.

-Joe
Bart Lateur

2004-07-23, 3:56 pm

A. Sinan Unur wrote:

>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. :)


Isn't that MSVC compiler a "bundle", too?

--
Bart.
A. Sinan Unur

2004-07-23, 3:56 pm

Bart Lateur <bart.lateur@pandora.be> wrote in
news:q972g0hbdu2pnj6ld7js8r6ca8ea35mg1k@
4ax.com:

> A. Sinan Unur wrote:
>
>
> Isn't that MSVC compiler a "bundle", too?


There are bundles and then there are bundles ...

--
A. Sinan Unur
1usa@llenroc.ude.invalid
(remove '.invalid' and reverse each component for email address)

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com