Re: Possible Perl/CGI Application

[email protected] (Greg Jetter)
Newsgroups perl.beginners.cgi
Organization Lazy Mountain Computers
Message-ID <[email protected]>
On Monday October 22 2007 6:04 pm, [email protected] wrote:
> I'm an engineer and I need to build a web based application for a
> customer to view results of my analysis. To simplify the problem say I
> have a duct with a length, width, and height. I have 'avi' files
> showing the fluid behavior in that duct for various combinations of
> these dimensions. The analysis package I use generates movies with the
> naming convention:
>
> length_width_height.avi
>
> I want to allow the customer to specify the length, width, and height
> and view the appropriate video file. Ideally using some combination of
> radio buttons, drop downs, etc.
>
> I am experienced in Perl and have have worked with simple HTML. I was
> told CGI might be the way to go in developing such an application. My
> question is, does that seem reasonable? I don't want to throw myself
> into learning CGI if I'm going to reach a point a few weeks down the
> road when I realize I should have taken a different approach.
>
> Thaks.
>
> Less

The main  reason you want to use CGI.pm is  the  OO way of  decoding  passed 
parameters from your HTML forms.

I assume your going to let  the client page  select  or build a combination of  
length , width , and height. Then send it to your Perl script to  run your 
application via a system call and  produce your output  AVI file . Then  you  
can again use  functions in the CGI.pm module to  push back  the resulting 
page. , you could do the  same thing without  CGI.pm but why would you want 
to re invent the wheel ?

instead of  decoding  a URL produced by your form manually , you  can  create 
a new CGI object and  then extract  the data like so

example:

use CGI;
use strict;

my $q = new CGI;

 # assuming  length is a  input field  of  some type on the form
my $length = $q->param('length');

then after you built the reply .
open the  file and print it to the browser ,  you  will need the correct mime 
type in your header..

take a look at the docs , it's  pretty common usage of  CGI.

that should get you going

good luck

Greg Jetter 
Alaska Internet Solutions
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.