#!/usr/local/bin/perl # # Demonstrates the passing of arguments by the -GET- method # You invoke it as follows: # staff.washington.edu/larryg/Classes/Rwebl/zz-url.cgi?name=Larry&color=blue # require 'cgi-lib.pl'; $request_meth = $ENV{'REQUEST_METHOD'}; $query_string = $ENV{'QUERY_STRING'}; # get args delimited by "&" ($nameEQ,$colorEQ) = split(/&/,$query_string); # split string based on '&' ($dmy,$name) = split(/=/,$nameEQ); # 1st arg after "?" ($dmy,$color) = split(/=/,$colorEQ); # 2nd arg after "?" print &PrintHeader; print <Simple XYY Output

Here is the Output of this screen


Your name is: $name
Your favorite color is: $color
ENDOFTEXT