Running perl from a browser without a web server?

Discussion in 'Perl Misc' started by sstark, Aug 22, 2005.

  1. sstark

    sstark Guest

    Hi, I'd like to run a perl script (using CGI.pm) from a web browser but
    without using a web server. Is there any way to do that?

    thanks
    Scott
    sstark, Aug 22, 2005
    #1
    1. Advertising

  2. sstark

    ChrisO Guest

    sstark wrote:
    > Hi, I'd like to run a perl script (using CGI.pm) from a web browser but
    > without using a web server. Is there any way to do that?
    >


    No.

    -ceo
    ChrisO, Aug 23, 2005
    #2
    1. Advertising

  3. sstark wrote:
    > Hi, I'd like to run a perl script (using CGI.pm) from a web browser but
    > without using a web server. Is there any way to do that?


    Why do you ask? If it's because you find it difficult to install a
    server, try this bundle: http://www.indigostar.com/indigoperl.htm

    It gives you Perl and Apache with CGI, mod_perl and PHP.

    Can't be easier than that.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Aug 23, 2005
    #3
  4. sstark

    Guest

    "sstark" <> wrote:
    > Hi, I'd like to run a perl script (using CGI.pm) from a web browser but
    > without using a web server. Is there any way to do that?


    HTTP::Daemon

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service $9.95/Month 30GB
    , Aug 23, 2005
    #4
  5. sstark

    Dave Weaver Guest

    On 22 Aug 2005 15:08:36 -0700, sstark <> wrote:
    > Hi, I'd like to run a perl script (using CGI.pm) from a web browser but
    > without using a web server. Is there any way to do that?


    I think you misunderstand how things work.

    Web browswers don't run Perl. Web browsers talk to web servers.
    Web servers can talk to programs written in Perl (or any other
    langauge) using the CGI.

    If you wish to write a CGI program you will need to have a web server
    for it to communicate with.

    There are freely available bundles that contain Perl & a web server
    that you can easily install on your own PC, for example IndigoPerl
    from http://www.indigostar.com/
    Dave Weaver, Aug 23, 2005
    #5
  6. sstark

    Brian Wakem Guest

    Brian Wakem, Aug 23, 2005
    #6
  7. sstark

    Eric Bohlman Guest

    "sstark" <> wrote in news:1124748515.933748.10230
    @g14g2000cwa.googlegroups.com:

    > Hi, I'd like to run a perl script (using CGI.pm) from a web browser but
    > without using a web server. Is there any way to do that?


    You'd have to build a "mini web server" into the program itself, so that
    when you start it (you'd have to do *that* using you're OS's program-start
    mechanism), it starts listening on a local port, which you in turn point
    your browser at. As Xho pointed out, you could use HTTP::Daemon to build
    it, though it would still involve a bit of work. IIRC,
    Net::HTTP::Server::Simple does a bit of the work for you.
    Eric Bohlman, Aug 23, 2005
    #7
  8. sstark

    sstark Guest

    Hi all, thanks for the many replies. To clarify:

    Yes I could easily install Apache; however for security reasons my
    employer forbids it, or at least requires a lot of security precautions
    that I'd rather not deal with. I'm looking at ways to make the script a
    standalone that I can give to users so they can run it on their own
    machines without installing a server.

    Perhaps the mini web server would do the trick, I'll look into that.

    What I'm really looking for, though, is simply a wysiwyg interface that
    allows users to click on choices and enter text into fields. Perhaps
    the browser/CGI solution isn't the only way. I seem to recall seeing
    some kind of Perl graphical interface a few years ago, some kind of
    "widget" thingie. Anybody know what I'm talking about and if there's a
    way to accomplish what I want?

    thanks,
    Scott
    sstark, Aug 23, 2005
    #8
  9. sstark

    Guest

    Eric Bohlman <> wrote:
    > "sstark" <> wrote in news:1124748515.933748.10230
    > @g14g2000cwa.googlegroups.com:
    >
    > > Hi, I'd like to run a perl script (using CGI.pm) from a web browser but
    > > without using a web server. Is there any way to do that?

    >
    > You'd have to build a "mini web server" into the program itself, so that
    > when you start it (you'd have to do *that* using you're OS's
    > program-start mechanism), it starts listening on a local port, which you
    > in turn point your browser at. As Xho pointed out, you could use
    > HTTP::Daemon to build it, though it would still involve a bit of work.
    > IIRC, Net::HTTP::Server::Simple does a bit of the work for you.


    I think it is just HTTP::Server::Simple, at least that is the closest I
    found at search.cpan.org. I wish I knew about this module earlier. (Or
    maybe I wish it existed earlier--it is pretty new.)

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service $9.95/Month 30GB
    , Aug 23, 2005
    #9
  10. sstark

    Paul Lalli Guest

    sstark wrote:
    > What I'm really looking for, though, is simply a wysiwyg interface that
    > allows users to click on choices and enter text into fields. Perhaps
    > the browser/CGI solution isn't the only way. I seem to recall seeing
    > some kind of Perl graphical interface a few years ago, some kind of
    > "widget" thingie. Anybody know what I'm talking about and if there's a
    > way to accomplish what I want?


    There are many different ways of creating GUIs with Perl. The one with
    which I am most familiar is Perl/Tk. If you installed ActiveState's
    version of Perl, you already have it installed. Take a look at
    perldoc Tk

    Otherwise, you can download the Tk toolkit from CPAN:
    http://search.cpan.org/~ni-s/Tk-804.027/pod/overview.pod

    You might also want to have a look at www.perltk.org

    Paul Lalli
    Paul Lalli, Aug 23, 2005
    #10
  11. sstark

    News KF Guest

    Hi,

    If your IT team is sensitive to servers, them I suggest, that your
    temporary server should just listen to the localhost (where the browser
    and the perlscript would be running).
    By this you would use the browser as generic graphical front end for
    your perl cgi scripts.

    Other option is of course to use perlTK.
    Depends on what you'd like to achieve exactly and how much experience
    you'r having with perl-cgi and html vs. tcl/tk , which perltk borrowed
    the widgets from.


    bye


    nkf


    sstark wrote:
    > Hi all, thanks for the many replies. To clarify:
    >
    > Yes I could easily install Apache; however for security reasons my
    > employer forbids it, or at least requires a lot of security precautions
    > that I'd rather not deal with. I'm looking at ways to make the script a
    > standalone that I can give to users so they can run it on their own
    > machines without installing a server.
    >
    > Perhaps the mini web server would do the trick, I'll look into that.
    >
    > What I'm really looking for, though, is simply a wysiwyg interface that
    > allows users to click on choices and enter text into fields. Perhaps
    > the browser/CGI solution isn't the only way. I seem to recall seeing
    > some kind of Perl graphical interface a few years ago, some kind of
    > "widget" thingie. Anybody know what I'm talking about and if there's a
    > way to accomplish what I want?
    >
    > thanks,
    > Scott
    >
    News KF, Aug 23, 2005
    #11
  12. sstark

    Damian James Guest

    On 23 Aug 2005 08:02:56 -0700, sstark said:
    > ...
    > What I'm really looking for, though, is simply a wysiwyg interface that
    > allows users to click on choices and enter text into fields. Perhaps
    > the browser/CGI solution isn't the only way. I seem to recall seeing
    > some kind of Perl graphical interface a few years ago, some kind of
    > "widget" thingie. Anybody know what I'm talking about and if there's a
    > way to accomplish what I want?


    There are several GUI toolkits available for Perl. You are probably
    thinking of Perl::Tk, but I suggest searching google for previous
    threads here about Perl GTK. WxPerl is another option.

    --Damian
    Damian James, Aug 24, 2005
    #12
  13. sstark

    ChrisO Guest

    sstark wrote:
    > Hi all, thanks for the many replies. To clarify:
    >
    > Yes I could easily install Apache; however for security reasons my
    > employer forbids it, or at least requires a lot of security precautions
    > that I'd rather not deal with. I'm looking at ways to make the script a
    > standalone that I can give to users so they can run it on their own
    > machines without installing a server.
    >
    > Perhaps the mini web server would do the trick, I'll look into that.
    >
    > What I'm really looking for, though, is simply a wysiwyg interface that
    > allows users to click on choices and enter text into fields. Perhaps
    > the browser/CGI solution isn't the only way. I seem to recall seeing
    > some kind of Perl graphical interface a few years ago, some kind of
    > "widget" thingie. Anybody know what I'm talking about and if there's a
    > way to accomplish what I want?


    I know it does little good to ask your company to "lighten up," but I'm
    always amazed at the things employers want and then tie their employees'
    hands behind their backs, usually in the name of "security." My own
    company is guilty of this too much to my chagrin sometimes.

    Anyway, not that it'll help en totale, but Simon Cozens had a rather
    nice article in The Perl Journal (TPJ) recently which spoke of this
    delimma of having an app whose presentation layer was a browser running
    against a web server installed on the same machine. Again, I know you
    said you can't do that, but the article might be worth a look anyway to
    see if it can give you some ideas.

    Also, with ActiveState Perl, you can install PerlScript on the
    *client-side* browser and run Perl in the browser same as Javascript,
    BUT... I doubt this will help you much and of course it doesn't provide
    a CGI interface. That requires something on the "backend" even if on
    the same machine, which is why I simply said "no" to your original
    question. Everyone here is presenting HTTP::Daemon and such, and it's
    merely a way of "tricking" your employer, which in my mind makes the
    forbiding of a real server install ludicrious. Those are still "backend
    servers," even if on the same box. You can't get around that. It's
    easy to install Apache to answer requests ONLY from the localhost hence
    providing you a local server that opens no security holes.

    But again, I sympathize. I've actually investigated the HTTP::Daemon
    thingy for the exact same reason, so I sympathize. The article however
    may provide other ideas or provide a platform for you to justify doing
    exactly what he did (which included a full hands-free install approach too.)

    -ceo
    ChrisO, Aug 24, 2005
    #13
  14. Dave Weaver <> writes:

    > Web browswers don't run Perl.


    It's more accurate to say that web browsers don't run CGI.

    But some of them can run Perl, under the right conditions. If you've installed
    ActivePerl for Windows, it integrates with the Windows Scripting Host. That
    means, among other things, you can put Perl inside of <script ...> elements and
    IE will be able to run it.

    Of course, that won't help the OP - it's an entirely different environment from
    CGI, and won't help with CGI development at all.

    sherm--

    --
    Cocoa programming in Perl: http://camelbones.sourceforge.net
    Hire me! My resume: http://www.dot-app.org
    Sherm Pendley, Aug 24, 2005
    #14
  15. sstark

    Flatman Guest

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (Darwin)

    iD8DBQBDDI3yexs8k4f5tB4RAlmHAJwNCLdsB0473bhrnY5snkfw05TesACeLhmG
    x43spO3u+e//HZAs0UF6vMM=
    =LtHl
    -----END PGP SIGNATURE-----
    Flatman, Aug 24, 2005
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    406
  2. Larry Woods
    Replies:
    17
    Views:
    240
    Larry Woods
    Aug 13, 2003
  3. zxcv

    running server code in browser

    zxcv, Dec 3, 2009, in forum: ASP General
    Replies:
    2
    Views:
    737
    Bob Barrows
    Dec 3, 2009
  4. Kapil Khosla

    Problems running perl without .pl extention

    Kapil Khosla, Jun 19, 2004, in forum: Perl Misc
    Replies:
    8
    Views:
    108
    Kapil Khosla
    Jun 20, 2004
  5. Replies:
    16
    Views:
    226
    Richard Cornford
    Sep 7, 2006
Loading...

Share This Page