IUBio GIL .. BIOSCI/Bionet News .. Biosequences .. Software .. FTP

A Simple CGI with Icarus

Ramu Chenna chenna
Sun May 4 10:40:07 EST 1997


Hello All 

I hope it is not too early to post this! Icarus will be more fun when
function calls made available. You can add this as an example for 
teaching icarus. 

Ramu

#!/usr/bin/icarus
#
#
#  A simple icarus cgi example
#
#  Chenna Ramu
#  EMBL, Heidelberg, Germany
#


# html variables
$tr = "<TR><TD>"
$tre  = "</TD><TR>"
$ntd = "</TD><TD>"

$mime_html = "Content-type: text/html\n\n"
$html_header = |<HTML> \
               |<TITLE> icarus example </TITLE> \
               |<H3> A Simple CGI example by Icarus </H3>  \
               |<TABLE border=2> <TH> Name </TH> <TH> Value </TH>

$html_trailer = "</TABLE> </HTML>"

$rule = {
  allEnv:  ~ line+ ~
  line:    ~ /([^=]+)=([^\n]+)?/ {
                  $Print:"$tr $1 $ntd $2 \n"} /\n/ ~
}

# get the envoronment variables 

$envi = ($System:env)
$Print:$mime_html 
$Print:$html_header

#do the job
$Parse:[$envi prod:$rule start:allEnv]

$Print:$html_trailer



          
===============================================================
 Chenna Ramu                            | EMBL
 E-mail: chenna at embl-heidelberg.de      | Postfach 10.2209
 Tel: (49) 6221 356229 (Res)            | 69012 Heidelberg
      (49) 6221 387398 (Off)            | Germany
 Fax: (49) 6221 387517
 URL: http://www.embl-heidelberg.de/~chenna/
===============================================================





More information about the Bio-srs mailing list

Send comments to us at archive@iubioarchive.bio.net