Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

possible: a perl plugin for web browsers?

by drfrog (Deacon)
on Aug 28, 2001 at 22:06 UTC ( #108526=perlquestion: print w/replies, xml ) Need Help??

drfrog has asked for the wisdom of the Perl Monks concerning the following question:

im mostly looking for opinions,
and maybe ,just maybe

people who could make this happen
{take my idea please!!}

im finding that java in an applet is not always
the lite solution for doing certain things on a web page
and i sigh and lament often about the
fact that there is no perl plugin for web browsers!!

there are many thing perl could do in this scenario
that would be most grand, dont you think?

anyone have any point comments or suggestions on this?
  • Comment on possible: a perl plugin for web browsers?

Replies are listed 'Best First'.
Re: possible: a perl plugin for web browsers?
by bikeNomad (Priest) on Aug 28, 2001 at 22:27 UTC
      as nice as that is i dont need that!
      i need perl with applet like abilities!

      from what i can tell perlscript is for asp pages?

      what i need is something where i can do realtime manipulation
      inside of the 'perl-let', in much the same way as java does

      maybe an explain is in order?

      i use a lot of vrml /web3d stuff

      they use a mechaism that is called EAI
      which stands for external application interface
      what this does is allow java to make calls back and forth to the vrml plugin
      {this can be done with other plugins too AFAIK}
      now, john stewart of freewrl {}
      has made it possible to use perl eai in freewrl
      this is great but not really deployable across multiple vrml plugins!
      what id like to see is this type of thing for perl
      as good as java is nothing beats perl for pattern matching!
      and heck i just like perl better than java!
      as well its good to have choices!!
Re: possible: a perl plugin for web browsers?
by vaevictus (Pilgrim) on Aug 28, 2001 at 22:37 UTC
    Well... If you mean to add a single "plugin" where you could run perl scripts, as opposed to installing activeperl (for windows clients), if feasible, the plugin would be large.

    Assuming that it was set up that way, we'd need to incorporate a GUI method for the webbrowser. Probably GTK or Glade or something, perhaps TCL/TK, which would morph into some sort of Browser::API; I'm not going into the holy war on GUIs thing.

    After we had this "plugin" in place, we'd have to work on the transport protocol. It'd be a terrible thing to have someone insert into a cleartext transmission from a webserver to a perl plugin some malicious code like system("your nasty commandline here"); Which means we'd need at least a CRC transmission test system and probably SSL.

    So... If we got the plugin created, and to an acceptible point where the clients would not have to worry about simple hack attacks, then we'd have something. I'm afraid I don't use much client side applications, so I don't use much java at all.

      defintley security is an issue
      we can look back through five years of how java did/didnt do it!

      i dont know if gui is a real issue
      i mean a java applet doesnt
      nessicarily output anything

      thats up to the developer and what their project needs

      the ability to use gtkglarea in a perl plugin
      would be super smoking

      i think size of the plugin could matter esp on windows
      but if it was included in activestates setup?
        i have to ask.
        why do you write <BQ>your posts like</BQ>
        well, if activestate was set up, we could just develop a perl package system... where all the code and optional libraries could be contained, possibly compressed, and CRC verified (to avoid simple tampering over TCP). This would be a very small download for most applications.

        OTOH, without activestate set up, the plugin would be very hefty, because you'd have to basically install perl somewhat... perhaps a binary distribution that was self contained could be rather win32 universal... I'm not sure.

        Regardless, the download would be very small for almost all "applets" ... :) ... it's the plugin download that'd get you. It'd basically activestate, with a small package management setup and mime type.

        The biggest problem would be getting anyone to set it up. Perl's *way* too powerful to just download something automatically from any site and execute it. :) Gives "Microsoft Free Fridays" a brutal edge to it, as soon as someone starts using malicious system calls. :)

        Thoughts anyone?

Re: possible: a perl plugin for web browsers?
by mr.dunstan (Monk) on Aug 29, 2001 at 10:52 UTC
    That's thinking outside-the-box baby!

    Perl is good for lots of things, but I imagine it would be slow for event-driven stuff like in-browser features.

    So, I ask your question with a question - what's the problem you're trying to solve? I think it would be extra fancy to have a perl-plugin browser type thing to help me build regular expressions - OR - to have perl's regular expression capabilities built into something that munges disconnected recordsets, client-side.

    But I digress, I'm not sure that's the best tool for the job. Security is job one, definitely. So (hypothetically) what would warrant using perl on the client side, in a web application?

    For the life of me, I can't think of it right now. Perl is great for a lot of things. Maybe an in-browser perl object editor would be something useful. Like some in-browser unit-testing device that lets you feed it regexp's and gives you a result based on some disconnected recordset. I have no idea. But I like your thinking!

      one of the problems im trying to solve is in my last post
      java development is very expensive in terms of dev time and project budget

      and for eai
      perl could do things a lot faster
      and with less difficulty

      this site has java eai examples

      ok i havent tested these code pieces
      thoughoughly but check it out
      there are some differences in the way they currently work
      mostly because there is no activex/pluing for perl!!
      here is the java directory of code for changing rgb
      check out its the core of it all
      there is an html page there you should be able to load if you hava a vrml plugin:
      say plugin under windows

      here is the perl code
      # Very simple: just get the TouchSensor event and give # a random color to the other box. # NOTE - this does not work very well, at all!!!! Have # to figure out how best to fix it. JAS. $PORT=90000; use IO::Socket; $server = IO::Socket::INET->new(Proto => 'tcp', LocalPort => $PORT, Listen => SOMAXCONN, Reuse => 1) or die("Can't set up server"); system("perl /usr/bin/freewrl t1.wrl -best -eai localhost:$PORT eai &" +); $sock = $server->accept(); $sock->autoflush(1); sub getlines { print " getlines starting\n"; my @arr; for(1..$_[0]) { print " EXPECTING ROW $_\n"; my $str = <$sock>; chomp $str; print " GOT '$str'\n"; push @arr, $str; } print " returning from getlines @arr\n"; return @arr; } # Test the sample EAI protocol. $a = <$sock>; $sock->print("TJL EAI CLIENT 0.02\n"); $sock->print("1\nGN TS\n"); my @l = getlines(4); # print "\ ok, REAL node of TS is $l[3]\n\n"; $sock->print("2\nGN MAT\n"); my @m = getlines(4); # print "\ ok, node of MAT is $m[3]\n\n"; # print " SENDING 3 RL $l[3] TouchTime XX\n"; $sock->print("3\nRL $l[3] touchTime XX\n"); my @l2 = getlines(4); # print " - Touchtime returned @l2\n"; # XXX This is fragile - it breaks if user clicks quickly and two event +s # come before our response gets to them while(@x = getlines(3)) { print " in while loop with @x\n"; if($x[1] ne "XX") {die("Invalid ev '$x[1]'")} $sock->print("15\nSE $m[3] diffuseColor\n".(join ' ',map {rand +} 0..2)."\n"); #@y = getlines(4); #print " finishing while loop with @y\n"; }

      please keep in mind this is the first
      implementation of perl eai in freewrl
      no other vrml viewer/browser
      has the capability of running perl...yet

      hope that helps in understanding!

      back in the day we didnt have no old school
Re: possible: a perl plugin for web browsers?
by little (Curate) on Aug 29, 2001 at 13:33 UTC
    IE 6 does not allow for plugins. So there you need Active-X control.
    So all in all, regarding the servr side let perl do the stuff, or let it cooperate with the java you already have.
    There is NO NEED to replace a working solution if its not buggy. But for the client side, why don't you just use java?
    C'mon man, it's a standard :-) Do you really want to reinvent the wheel by reimplementing a full blown java application into perl? Yes, I had a look at your previous posts ;-)
    Well, interesting it will become in the future anyway, when your java runs on anything but not on Windows XP. But there ActivePerl will run and allow for perlscript, but sadly, wich "normal" webuser wants to install that huge package just to use your site?

    Have a nice day
    All decision is left to your taste
      ok i do realize it has to be an
      active x control for one browser!!lol

      not everything i do is server side
      the thing is its not about replacing a working solution,
      its about having choices

      sure java is great but have you ever had
      to make an applet that worked:

      a) on multiple o/s's?
      b) on multiple browser and versions?
      c) had to work on a java project with more than one class file?
      d) had to recompile recompile recompile the java code?
      e) had to use jar files that are out of date/have no source code?{ahhh cpan}

      perl would eliviate a lot of this redundant work
      and of course drive down the cost of the project too!!

      look at my next post i wil be providing examples between the java and perl versions of eai
      {i just wanted to address this post seperately}

      back in the day we didnt have no old school

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://108526]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (1)
As of 2022-05-21 21:07 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (78 votes). Check out past polls.