#!/usr/local/bin/perl -w use strict ; use English ; use Socket ; use CGI qw/:all/ ; my($rec) ; my(@Record) ; my($cgi) ; my(%Hash) ; my($String) ; my($item) ; $cgi = new CGI ; # # See if there were passed values from the input form # if ( $cgi->param('string') ) {$String = $cgi->param('string') ;}; if ( $cgi->param('array') ) {@Record = $cgi->param('array') ;}; # If string has a value, then do the following. If not, # present the input form. if ( $String ) { Header() ; print "The String is: $String
\n" ; print "The Array has in it:
\n" ; foreach ( @Record ) { print "File: $_->{file}\n" ; print "Item: $_->{item}\n" ; } ; print "We're done.....\n" ; closeHTML() ; # This is the input form....... } else { # Load up the array with some stuff.... $rec->{'file'} = "/usr/local/bin/myfile" ; $rec->{'item'} = "type: file" ; push ( @Record, $rec ) ; $rec->{'file'} = "/usr/local/bin/ourfile" ; $rec->{'item'} = "type: file" ; push ( @Record, $rec ) ; Header(); print "
Enter a string in this box:" ; print "
\n" ; print hidden('array', @Record) ; print " " ; print "
\n" ; closeHTML(); } ; ############### HTML Header ################### sub Header { print "content-type: text/html\n\n" ; print "\n" ; print "\n" ; print "Pass the array\n" ; print "\n" ; print "

\n" ; print "Array:\n" ; print "

\n" ; print "\n" ; print "\n" ; } ; ################# close HTML ################## sub closeHTML { print "\n" ; print "\n" ; print ""; } ;