Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Hands-on of Perl by Web

by shonorio (Hermit)
on May 03, 2006 at 22:04 UTC ( #547286=perlquestion: print w/ replies, xml ) Need Help??
shonorio has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

The brasilian PM groups are talking to build one kind of pseudo-interactive-perl-shell by web. The idea behind this pseudo-shell-interactive is to create e-learning course of Perl, where students will could do classes exercises direct on her/his web browser. Our first course will be PerlIntro.POD translated to e-learning course.

We think this could be very nice for Windows users, and for someone that just would like try Perl.

Well with this idea, now we are talking how to implement this on real world, and divided this implementation on 2 possible technology, as :

* Server-side
Where we will use a web browser (with JavaScript+AJAX) just to get the user command and run this command on Perl instance install at server.
Here we are afraid about security at server (there is a way to run this remote code in a safe way at server ?) and how big will be server to run many interactive users ?

* Client-side
Where we will use a web browser to work as pseudo-shell-interactive, embedding Perl on a Java Applet or other stranger technology.

I would like help to figure-out one good way to implement this pseudo-interactive-perl-shell by web, or just say "Don't waste time with this stupid idea :( !!!".


Solli Moreira Honorio
Sao Paulo - Brazil

Comment on Hands-on of Perl by Web
Re: Hands-on of Perl by Web
by jpeg (Chaplain) on May 03, 2006 at 23:03 UTC
    Hi Solli,

    Can you explain why you chose a web browser talking to one server?

    It sounds like you're trying to reinvent a wheel. Think about it: If you need people to talk to one central server, give them ssh accounts with a restricted shell and let them write and run Perl there. If you want to let them use Perl without having to install anything locally, suggest they use a Knoppix disk. (Can ActivePerl be run from a CD?)

    I'm sorry to suggest that you look for another solution. Can you explain your requirements in more detail?

      I object to your comment about reinventing the wheel. I think in this case it's more like making the wheel easier to put on your car.

      I know the Linux guys hate to hear this, but to most users, running fewer programs makes things easier. Pretty much every computer I've ever seen comes with a web browser installed so a web based solution requires almost zero effort for the user. Plus you have firewalls to consider.

      As for securing it, that probably would be easier with something like SSH.

      Fletch and Cap'n Steve answered your question as I would. This idea is based on the "Try Ruby", where I could see a little about this languange without install anything on my machine, and why not do the same for Perl ?

      Solli Moreira Honorio
      Sao Paulo - Brazil

      Can ActivePerl be run from a CD?

      I've been able to run Perl and TinyPerl from a BartPE CD as well as running PerlIDE to debug scripts under WindowsXP.

      The big problem with using BartPE is that each user would have to build his/her own CD because of copyright. So I don't believe BartPE would be a good solution. However, as proof of concept it shows that you can get Perl to run off a CD on Windows.


Re: Hands-on of Perl by Web
by cdarke (Prior) on May 03, 2006 at 23:19 UTC
    As a trainer I agree with jpeg. Use a browser to direct students, show slides, and so on, but practical work should be done locally. Otherwise you may have security and performance issues.
      I'm a Perl's trainer too and agree you about pratical work, but this idea is about "try Perl in 15 minutes". That's why I'm consulting you about a better way (if exist) to do this.

      Solli Moreira Honorio
      Sao Paulo - Brazil
Re: Hands-on of Perl by Web
by BUU (Prior) on May 03, 2006 at 23:22 UTC
    Doing it via ajax isn't terribly complicated, neither is executing perl in a safe way. I've been running a bot that does much the same thing for a while now and a combination of chroot and a bunch of restrictive ulimits have made it extremely safe.
      May you could share your solution ?

      Solli Moreira Honorio
      Sao Paulo - Brazil
        Chroots and ulimits were my solution. Fork a process, chroot it to someplace useless, add a series of extremely restrictive ulimits for memory, open files, cpu and so forth, then have it drop to a nobody user so it can't change them.

        If you're interested in working further on this, send me a private message and we can talk specifics.
Re: Hands-on of Perl by Web
by TedPride (Priest) on May 04, 2006 at 05:10 UTC
    The algorithms class I'm just finishing now let me write my solutions in Perl. Basically, I'd write them up in my text editor, FTP them in, then connect via ssh and run them, storing my session text in a file. Not terribly hard, once I knew what the proper Unix commands were for all that.

    I suppose you could do much the same thing with a secure server and user login system, but since you generally want to test your code locally before uploading it anyway, I don't see how this approach really improves things.


      This will work well for a 'regular' course, but the idea here is just to 'try Perl' on the fly by web browser, if it's possible

      Solli Moreira Honorio
      Sao Paulo - Brazil

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2014-07-12 15:19 GMT
Find Nodes?
    Voting Booth?

    When choosing user names for websites, I prefer to use:

    Results (240 votes), past polls