#!/usr/local/bin/perl =pod this is a sample AIS "query" program, which looks up single-use keys provided in its query string and replies with a block of AIS-XML. =cut use strict; use DirDB; tie my %OTU, 'DirDB', './data/OTU_keys'; my $xmlblock = $OTU{$ENV{QUERY_STRING}} || <ERROR provided single use key not found in AIS data http://$ENV{SERVER_NAME}/cgi/ais/ $ENV{REMOTE_ADDR} DEFAULT delete $OTU{$ENV{QUERY_STRING}}; # anyone know how to # incorporate return-by-delete # into the previous statement? my $email; if (($email)=$xmlblock=~m#(.+)#si and $email ne 'NULL' and $email ne 'ERROR' ){ open(MAIL,"|sendmail -t -i -f 'AIS-bounce-recipient\@$ENV{SERVER_NAME}'"); print MAIL < Subject: AIS web service query receipt AIS has provided the following XML block to a web service querying it from IP address $ENV{REMOTE_ADDR} as agent $ENV{HTTP_USER_AGENT} $xmlblock EOF }; print < $xmlblock EOF __END__