in reply to Should we have PerlC and PRE?

Don't forget that this will only work for pure Perl modules. XS modules get compiled to native object code at build/install time and this is stored in a platform specific dynamically loadable object (DLL or .so).

One of the other posters mentioned HTML::Parser as an example - in fact, HTML::Parser includes an XS component, so only a very small part of it gets compiled to bytecode. Many useful modules are Perl wrappers for C libraries (GUI libraries, DBI/DBD, compression, encryption, etc) and also wouldn't be compatible with your proposal.

But let's go back to the original problem - Perl doesn't allow you to use components without installing them first. Well hello! Write a VB app and you'll have to install both the VB runtime and any ActiveX controls you need on target machines. Java is the same - sure you can package stuff in a JAR file but any class which wraps a native library will need that library installed too. The typical Java response to this problem is to re-implement a library in Java. Even a C app requires you to have the required libraries installed (unless you squander resources and link everything statically).

Replies are listed 'Best First'.
Re: Re: Should we have PerlC and PRE?
by bart (Canon) on Dec 08, 2002 at 18:38 UTC
    Write a VB app and you'll have to install both the VB runtime and any ActiveX controls you need on target machines.
    Now it is so, sadly. Thanks to OLE and ActiveX. But with VB3, one of the latest version of VB for 16-bits, it didn't need it: just put your executable, the VB runtime engine, and any VBX files you used (plus DLL's as used by the VBX'es behind the scenes) all in one directory on a CD-ROM, and you could run it on any PC which had a CD-ROM drive, without installation. It was a major advantage.

    And with a perl application "compiled" into one executable with perl2exe (or likely PerlApp, though I have not tried that), you can now (still) do the same with a Perl script. Even if it includes XS modules, as compiled DLL files are included as well.