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


In reply to Re: Should we have PerlC and PRE? by grantm
in thread Should we have PerlC and PRE? by dingus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.