Parsing query string from cgi

Im having trouble getting the string I get from a cgi form to only be the value entered. I need to use that value as an argument but cant use it in the way it is returned. I get "bustype = restaurant" but I want just "restaurant" because i am going to be using that value as an argument in a csh file to display a table from mysql. I know it should be simple but I cant get it to work. Thanks.

how do you get the string to come up? is it like "grep bustype somefile" or something like that?

Do something like this if using POST

# process POST key / value pairs
read( STDIN, $query_string, $ENV{ 'CONTENT_LENGTH' });

@key_value_pairs = split ( /&/, $query_string );
  foreach $key_value ( @key_value_pairs ) {
    ( $key, $value ) = split ( /=/, $key_value );
    $value =~ tr/+/ /;
    $value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ( $1 ) )/eg;
    $FORM{ $key } = $value;
}

Then you can access the elements, e.g.
$FORM{ 'foo' }
would correspond to the form control with name="foo" in it's tag in your html page.

Cheers
ZB

For Perl, extracting a query parameter does not need to be verbose as that.

use CGI;
$cgi = new CGI();
$bustype = $cgi->param('bustype');

For csh CGI script, I can't help as I don't use it.