[Techtalk] Perl script how to

Helen hrosseau at rogers.com
Wed Aug 30 01:18:11 UTC 2006


This is a copy of what I have so far, minus a few <option>s. I have now 
downloaded and installed the cgi-lib.pl as mentioned and I have tried 
repeatedly to get the scripts to work, with no success.  The perl script 
runs so quickly that it is not possible for the expect script to start 
running.

Helen

<html>
<head>
<title>test the select option</title>
</head>
<body>
<h1>select advanced option</h1>
<hr>
<form action="../cgi-bin/run_advanced.pl" method="get">
this form makes it possible to display expect scripts<br>

what script would you like to run:
<SELECT NAME="advanced" size=1>
 <OPTION>telnet_term_ACQ_TM.exp
 <OPTIOn>telnet_term_BB0_GCOUNT.exp
 <OPTION>telnet_term_BB0_NMSU.exp
 <OPTION>telnet_term_pCOUNT.exp
 <OPTION>telnet_term_BB1.exp
 <OPTION>telnet_term_BB1_info.exp
  <OPTION>telnet_term_tu_status.exp
</SELECT>
<p>
<input type="submit" value="submit the form">
<input type="reset" value="clear all fields">
</form>
<hr>
</body>
<html>


#! /usr/bin/perl

use strict;
use warnings;

print "Content-type: text/exp\n\n;

$rxvt;

parse_form_data (advanced);
$NAME = $advanced {'NAME'};
$NAME;

else die;



>>   ----- Original Message ----- 
>>   From: Tamara Harpster
>>   To: Helen ; techtalk at linuxchix.org
>>   Sent: Monday, August 28, 2006 4:34 PM
>>   Subject: Re: [Techtalk] Perl script how to
>>
>>
>>   Let me see if I can explain a little more on this. You can have the
>>   script run at the command line and still not have it activated by the
>>   form when the HTML page calls it. And the library I am referring to is 
>> a
>>   CGI library that allows reading the variables from the web server, for
>>   example, the value of the select option that is sent.
>
> We use 'uncgi' http://www.midwinter.com/~koreth/uncgi.html .  It's a 
> program
> that translates the POST / GET values to environment variables.  Then your
> script uses $WWW_foo where you had an <input type="text" name="foo"> in 
> your
> HTML form.  You use <form action="/cgi-bin/uncgi/your_script"...> where 
> your
> script is stored in /cgi-bin/your_script .
>
> Here's a sample of one of our webform/cgi script units.  sql.cgi is a csh
> script but it could be anything that can read / process the $WWW_...
> environment variables.  Within that you could process your expect scripts
> and reformat their output for display as html.  This script uses 'grep' to
> filter the returned data and 'sed' to reformat it as an HTML table.
> <<snip>>>
> Conor
> Conor Daly,
> Met Eireann, Glasnevin Hill,
> Dublin 9, Ireland
> Ph +3531 8064276 Fax +3531 8064247
>




More information about the Techtalk mailing list