Professional Web Applications Themes

web-based application question - PERL Beginners

Hi, I have a perl script that I would like to make available on-line. I suspect the target community (microbiologists) has no interest in getting/learning perl for themselves and would prefer to use it as an on-line resource. Since I am a newbie at much of this, I was wondering if someone could direct me where I can learn to do this. My plan would be to have people upload a file and execute the script and be able to have the results (several files) emailed to them when the script is done running. The script can take awhile to ...

  1. #1

    Default web-based application question

    Hi,

    I have a perl script that I would like to make available on-line. I
    suspect the target community (microbiologists) has no interest in
    getting/learning perl for themselves and would prefer to use it as an
    on-line resource. Since I am a newbie at much of this, I was wondering
    if someone could direct me where I can learn to do this.

    My plan would be to have people upload a file and execute the script and
    be able to have the results (several files) emailed to them when the
    script is done running. The script can take awhile to run so it would
    be good if the submitter could leave the site while the script is being
    executed. I'm sorry if this idea and question seems a bit naive but I'm
    not sure how/if I should go about doing this. Any suggestions would be
    great.

    Thanks,
    Pat

    Pd Schloss Guest

  2. #2

    Default Re: web-based application question

    On Wednesday, October 15, 2003, at 09:03 AM, PD Schloss wrote:
    > Hi,
    >
    > I have a perl script that I would like to make available on-line. I
    > suspect the target community (microbiologists) has no interest in
    > getting/learning perl for themselves and would prefer to use it as an
    > on-line resource. Since I am a newbie at much of this, I was wondering
    > if someone could direct me where I can learn to do this.
    >
    > My plan would be to have people upload a file and execute the script
    > and
    > be able to have the results (several files) emailed to them when the
    > script is done running. The script can take awhile to run so it would
    > be good if the submitter could leave the site while the script is being
    > executed. I'm sorry if this idea and question seems a bit naive but
    > I'm
    > not sure how/if I should go about doing this. Any suggestions would be
    > great.
    Here's some thoughts I had, just reading your message.

    I would convert your script to run as a daemon in the background. Have
    it watch a specific directory and get to work whenever a file pops up
    there. When it's done, email the results off.

    After that you just need a web page with an upload form and a simple
    CGI script that drops the file in the right directory. You may
    actually need to drop two files, since you'll probably need some other
    metadata (an email address, for example). Also remember the cardinal
    rule for this type of "mailbox" setup, add the file to the directory
    with some name or extension your script ignores, then rename it to
    something the script will pick up on. This keeps your script from
    seeing the file until it's complete.

    Well, those are just some of my basic ideas. Hope that at least gets
    you thinking in the right direction. Good luck with your project.

    James
    > Thanks,
    > Pat
    >
    >
    > --
    > To unsubscribe, e-mail: [email]beginners-unsubscribeperl.org[/email]
    > For additional commands, e-mail: [email]beginners-helpperl.org[/email]
    >
    James Edward Gray II Guest

  3. #3

    Default RE: web-based application question


    ------------------------------------------------
    On 15 Oct 2003 09:03:01 -0500, PD Schloss <pdsplantpath.wisc.edu> wrote:
    > Hi,
    >
    > I have a perl script that I would like to make available on-line. I
    > suspect the target community (microbiologists) has no interest in
    > getting/learning perl for themselves and would prefer to use it as an
    > on-line resource. Since I am a newbie at much of this, I was wondering
    > if someone could direct me where I can learn to do this.
    >
    In general if you have some background with Perl then the amount you need to learn to do simple online apps is relatively small. For starters there is a 'CGI' specific list (beginners-cgi) that you may get better help from at times, though your post is not off topic for this list either. Secondly you should check out the CGI.pm base module, as well as the CGI::Application modules. Reading through their doentation, if you are used to POD, should enlighten you a lot. If you are still confused at that point or prefer not to dive right in then there are just about as many books on CGI as microbiology these days ;-) pick one and have at it, there are also a ton of online tutorials, mileage varies...
    > My plan would be to have people upload a file and execute the script and
    > be able to have the results (several files) emailed to them when the
    > script is done running. The script can take awhile to run so it would
    > be good if the submitter could leave the site while the script is being
    > executed. I'm sorry if this idea and question seems a bit naive but I'm
    > not sure how/if I should go about doing this. Any suggestions would be
    > great.
    >
    Sounds like a good start to a plan. You are going to run into a number of issues that people always encounter with CGI design limitations, etc. but for the most part your app is doable. Some things to keep in mind would be whether just anyone can use it, do they need to register/login, is there a queue as it sounds like this is a long running process and it will timeout the browser. So presumably the jobs would be uploaded, shoved into a queue, and then performed in a FIFO manner. If this is the case do you or how do you notify the user that their job is complete. How do they get the results? email? Are you going to keep a job queue number and send them an email with a link that takes them to a page that displays the results for a job? If they submit multiple jobs can they get a list of all of the jobs they have run? (this goes back to the register/not register)...

    These are just some of the things you will want to think about, and all of that sounds daunting, it doesn't have to be that complicated, so first I would layout exactly how you are expecting things to go.

    Assuming I am correct about the "batch job" processing, then you should start by improving your current tech to work in that type of manner (aka a queueing type setup) and that will drive what information you then need from/to the web interface.

    Whether you should write it at all is really up to whether or not it is worth it to you as a personal learning experience, whether or not anyone will use it (if you are the kind of person that prefers everything to have a purpose), whether or not you can utilize it, presumably you have written something that others can use because you would use it, so you should at least have 1 user right? And finally whether or not there is already something out there that does the exact same thing and costs the same amount, don't reinvent the wheel, invent a different one :-)...

    [url]http://danconia.org[/url]
    Wiggins D'Anconia Guest

  4. #4

    Default RE: web-based application question

    Hi,

    If your application will be doing search and retrieval, there's a good
    chance something similar has already been developed that can be used as
    a starting point.

    [url]http://www.perl.com/pub/q/resources[/url] is a good starting point for finding
    out what's already available in perl.

    An excellent intro for adding search functionality to perl apps is at
    [url]http://www.perl.com/pub/a/2003/09/25/searching.html[/url]. There are some
    good additional references on the last page.

    Regarding writing a unix daemon in perl, you might have a look at
    [url]http://www.webreference.com/perl/tutorial/9/index.html[/url]

    -tristram

    Tristram Nefzger Guest

  5. #5

    Default Re: web-based application question

    On Wednesday 15 Oct 2003 3:03 pm, PD Schloss wrote:
    > Hi,
    >
    > I have a perl script that I would like to make available on-line. I
    > suspect the target community (microbiologists) has no interest in
    > getting/learning perl for themselves and would prefer to use it as an
    > on-line resource. Since I am a newbie at much of this, I was wondering
    > if someone could direct me where I can learn to do this.
    >
    > My plan would be to have people upload a file and execute the script and
    > be able to have the results (several files) emailed to them when the
    > script is done running. The script can take awhile to run so it would
    > be good if the submitter could leave the site while the script is being
    > executed. I'm sorry if this idea and question seems a bit naive but I'm
    > not sure how/if I should go about doing this. Any suggestions would be
    > great.
    >
    > Thanks,
    > Pat
    Hi Pat,

    If you don't want to go down the web server route, one method is to simply
    stick to email for both transactions. Using most mail servers, you can
    redirect incoming messages to a pipe and therefor to any program you wish.

    This script could extract the attachment, pass it to your program which then
    generates the resulting output files, which then get attached to an email and
    sent to the originating email address.

    If you look on CPAN ([url]http://search.cpan.org[/url] is my favourite way) there are
    shed-loads of modules for extracting from and creating email messages.

    Gary
    --
    Gary Stainburn

    This email does not contain private or confidential material as it
    may be snooped on by interested government parties for unknown
    and undisclosed purposes - Regulation of Investigatory Powers Act, 2000

    Gary Stainburn Guest

  6. #6

    Default Re: web-based application question

    On Wednesday 15 Oct 2003 3:21 pm, James Edward Gray II wrote:
    > On Wednesday, October 15, 2003, at 09:03 AM, PD Schloss wrote:
    > > Hi,
    > >
    > > I have a perl script that I would like to make available on-line. I
    > > suspect the target community (microbiologists) has no interest in
    > > getting/learning perl for themselves and would prefer to use it as an
    > > on-line resource. Since I am a newbie at much of this, I was wondering
    > > if someone could direct me where I can learn to do this.
    > >
    > > My plan would be to have people upload a file and execute the script
    > > and
    > > be able to have the results (several files) emailed to them when the
    > > script is done running. The script can take awhile to run so it would
    > > be good if the submitter could leave the site while the script is being
    > > executed. I'm sorry if this idea and question seems a bit naive but
    > > I'm
    > > not sure how/if I should go about doing this. Any suggestions would be
    > > great.
    >
    > Here's some thoughts I had, just reading your message.
    >
    > I would convert your script to run as a daemon in the background. Have
    > it watch a specific directory and get to work whenever a file pops up
    > there. When it's done, email the results off.
    >
    > After that you just need a web page with an upload form and a simple
    > CGI script that drops the file in the right directory. You may
    > actually need to drop two files, since you'll probably need some other
    > metadata (an email address, for example). Also remember the cardinal
    > rule for this type of "mailbox" setup, add the file to the directory
    > with some name or extension your script ignores, then rename it to
    > something the script will pick up on. This keeps your script from
    > seeing the file until it's complete.
    >
    > Well, those are just some of my basic ideas. Hope that at least gets
    > you thinking in the right direction. Good luck with your project.
    >
    > James
    >
    James,

    I'm curious, why bother running a daemon which needs starting/stopping, and
    watching to make sure it doesn't die, when if you're going to use CGIs to
    populate the directory in the first place, why don't you simply call the
    script from there?

    > > Thanks,
    > > Pat
    > >
    > >
    > > --
    > > To unsubscribe, e-mail: [email]beginners-unsubscribeperl.org[/email]
    > > For additional commands, e-mail: [email]beginners-helpperl.org[/email]
    --
    Gary Stainburn

    This email does not contain private or confidential material as it
    may be snooped on by interested government parties for unknown
    and undisclosed purposes - Regulation of Investigatory Powers Act, 2000

    Gary Stainburn Guest

  7. #7

    Default Re: web-based application question

    > James,
    >
    > I'm curious, why bother running a daemon which needs starting/stopping, and
    > watching to make sure it doesn't die, when if you're going to use CGIs to
    > populate the directory in the first place, why don't you simply call the
    > script from there?
    >
    >
    What happens when 1 file takes 2 minutes to process, and you get 500 users a minute? I'd hate to be on that server...

    By separating the process into an upload/web interface with a background batch component you can throttle the processing while still accepting the most amount of connections.

    [url]http://danconia.org[/url]
    Wiggins D'Anconia Guest

  8. #8

    Default Re: web-based application question

    On Wednesday, October 15, 2003, at 10:21 AM, Gary Stainburn wrote:
    > James,
    >
    > I'm curious, why bother running a daemon which needs
    > starting/stopping, and
    > watching to make sure it doesn't die, when if you're going to use CGIs
    > to
    > populate the directory in the first place, why don't you simply call
    > the
    > script from there?
    My thought here was that if the web service became popular and a lot of
    people were submitting files, you could launch many copies of a
    possibly resource hungry script which could lead to bad things. That's
    why I would probably prefer to keep one script working through the
    files at a time.

    James

    James Edward Gray II Guest

Similar Threads

  1. Standalone flash based database application
    By ritur in forum Macromedia Flash Data Integration
    Replies: 8
    Last Post: March 14th, 01:23 PM
  2. DHTML/CSS based photo album web application
    By deal geek in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: July 30th, 08:45 PM
  3. Create a web-based paint application with Flash
    By Seb in forum Macromedia Flash
    Replies: 1
    Last Post: February 2nd, 11:53 AM
  4. beginner question doent based application
    By Paul Forgey in forum Mac Programming
    Replies: 2
    Last Post: September 15th, 09:28 PM
  5. perl code to test my C based CGI application
    By chris in forum PERL Miscellaneous
    Replies: 5
    Last Post: June 30th, 03:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139