http://qs321.pair.com?node_id=430508

Felow monks,

Recently I was developing a new module, called lib::http, where is possible to use a Perl library installed in other server over the internet. Also with this release is distributed a modified Perl interpreter, actually a modified TinyPerl, that doesn't have any lib, but with it is possible to use a full perl installation over the internet.

The main idea is to use Perl without need to install anything, and to have a central point to load modules, where is possible to update a full grid of servers changing only a single place. So, we can update all the services writed in Perl that works in our grid changing a single Perl installation, what is much more faster, and as a plus we can hide some modules, since we can tell to load this modules only in the memory, without need to store them fisically in the server.

lib::http was created only in the last week and still need tests, of course, but it's working very well, and already have support for gzip compression, index of a perl library in the server side, and works in any simple HTTP server.

Should be at CPAN soon:
http://csociety-ftp.ecn.purdue.edu/pub/CPAN/authors/id/G/GM/GMPASSOS/

Enjoy! ;-P

Graciliano M. P.
"Creativity is the expression of liberty".

Replies are listed 'Best First'.
Re: lib::http - Using virtually a Perl library from the Internet with the HTTP protocol.
by theorbtwo (Prior) on Feb 13, 2005 at 04:33 UTC

    The problem with doing this is that now all somebody has to do to comprimise the system of everybody running this with the defaults is to break in to the sourceforge account, or otherwise modifiy the files there. Even worse, since you used a domain name, it's possible to use DNS posining to fake things, and point at another server completely.

    It'd be nice if this did https, and had a parameter for easy checking of the server's Client-SSL-Cert-Subject and Client-SSL-Warning psuedoheaders.

    Oh, and nitpick: "fisically" referrers to financials, "physically" is the opposite of "virtually".


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

      1st, we don't need to have a installed Perl in the Web Server, you can copy the perl Library of any Perl distributin of any OS and put in the server, and actually is what we do here.

      About the DNS, well, use the IP, and a HTTP access is used for almost any system in the internet, so, is not less secure than any other system.

      The SSL support can be a new resource in the future, but we can't forget that the idea is that lib::http need to be self contained, since only with lib::http loaded in the Perl interpreter we need to be able to active all the resource to load things from the internet, or will not make sence to already have a big Perl library installed locally, since what I really want is to not have any Perl Library installed, only the internet one.

      Graciliano M. P.
      "Creativity is the expression of liberty".

      I'd say "fisically" doesn't mean anything, but "fiscally" is related to financials. This kind of spelling mistake (physical --> fisical) is very common when your native language uses "f" instead of "ph" and "i" instead of "y". It's something deeply ingrained into one's consciousness; I still do it every once in a while when I get distracted.
Re: lib::http - Using virtually a Perl library from the Internet with the HTTP protocol.
by holli (Abbot) on Feb 13, 2005 at 00:14 UTC
    very nice++. but since all-lowercase module names are preserved for pragmas, i think you should think about renaming your module, eg. Lib::Http.

    Update:
    Oops. I assumed that pragmas are supposed to be one-worded. but rereading the perldoc i found nothing that backs that. Also there are threads::shared and warnings::register as precedents.
    tx, theorbtwo, another wonderful example how dangerous assumptions are ,)

    holli, /regexed monk/

      lib::http, as described above, is a pragmata, every bit as much as the standard lib is.

      Minor nit: I'd suggest Lib::HTTP only because Http looks ridiculous, being an acronym.
      I put this name because we already have a "pragma" module called lib, and lib::http works exatcly like it, but over the internet.

      Graciliano M. P.
      "Creativity is the expression of liberty".

Re: lib::http - Using virtually a Perl library from the Internet with the HTTP protocol.
by castaway (Parson) on Feb 13, 2005 at 07:48 UTC
    It looks quite interesting, and certainly useful for an intranet or similar.

    May I suggest though, that you spell check the documents, and/or get someone else to read them? (Maybe you were having a bad spelling day, since I don't recall your other docs being quite so bad :)

    Ther's no mention of speed any where, I assume it depends on the network, but it would still be interesting to see some numbers, for a local lan, for example. (I can see it being most useful with mod_perl or persistent perl, where load-once is the norm).

    C.

      I did some work to cache all that is possible. What we can't forget is that the files are downloaded compressed, and are not downloaded more than 1 time, unless when they are modified. Basically if you have a normal Perl installed, you actually did the same job, transfer the compressed installation to the machine, what we do with lib::http is to load in steps, and only load what is needed, when is needed.

      Graciliano M. P.
      "Creativity is the expression of liberty".

        That doesn't answer my question whatsoever. I was looking for numbers, not reasoning.

        C.

Re: lib::http - Using virtually a Perl library from the Internet with the HTTP protocol.
by tomhukins (Curate) on Feb 14, 2005 at 10:50 UTC
    Did you know about Acme::Intraweb when you wrote your module? The two seem to have lots in common.
      Can be simillar, but Acme::Intraweb actaully will install a module from CPAN, what need a full Perl installed and a compiler. The idea of lib::http is to not have anything installed.
        Yes, but both modules still have plenty in common. Subclassing helps avoid code duplication; reading similar code often enlightens.
Re: lib::http - Using virtually a Perl library from the Internet with the HTTP protocol.
by dragonchild (Archbishop) on Feb 13, 2005 at 20:18 UTC
    What advantage does this have over SOAP or XML-RPC? All I can tell is that this is more insecure and doesn't provide any scalability benefits.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      I think you might be missing the point. How does SOAP or XML-RPC let you load libraries across the network (NOT run code remotely)? It seems the main point of lib::http would be to make it easy to update many, many servers with new versions of modules (like gmpassos described).
        So, my applications that are distributed across a bazillion servers are completely dependent on one application on one machine being up and running and not in an endless loop and ...

        What's wrong with CPAN? crontab and CPAN work just fine, especially with a local CPAN repository.

        Being right, does not endow the right to be rude; politeness costs nothing.
        Being unknowing, is not the same as being stupid.
        Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
        Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      lib::http is not for remote process call, if you haven't undertand it yet! Is just a different way to USE libraries from your Perl interpreter, much more about how to distribute and update your code, than call it.

      Graciliano M. P.
      "Creativity is the expression of liberty".