#!/usr/local/bin/perl -w # notification_of_intended_use.pl # Routine generates web page for requesting use name, address, and # information about how they plan to use the data. # Assumptions: # 1. A pattern application is read in from the filespec # specified in $ARGV[0] or in $pattern_file if $ARGV[0] is undefined # and any environment variables of the form $NAME are translated before # output to STDOUT. # V1.00 November 19, 1999 R. Groman $version = "V1.00 November 19, 1999"; $| = 1; print STDOUT ("Content-type: text/html\n\n"); if (defined $ARGV[0] and $ARGV[0] ne "") { $pattern_file = $ARGV[0]; } else { $pattern_file = "/data5/globec/httpd/htdocs/globec-dir/data_doc/" . "notification_of_intended_use_pattern.html"; } unless (open PATTERN_FILE, $pattern_file) { print STDOUT < Notification of intended use - error

Notification of intended use - error

Cannot open the pattern file $pattern_file. Please contact the Data Management Office


$version ERROR_NO_PATTERN_FILE exit; } while () { unless ( m/\$[A-Z_]*/ ) { print STDOUT ("$_"); } else { $variable = $_; $variable =~ s/.*\$([A-Z_]*).*/\$$1/; # print STDOUT ("**debug, variable=$variable\n"); $value = `echo $variable`; chomp $value; # print STDOUT ("**debug, echo result=$value\n"); if ($value =~ m/Undefined/ or $value eq "") { s/\$[A-Z_]*/Undefined/; } else { s/\$[A-Z_]*/$value/; } print STDOUT ("$_"); } } close PATTERN_FILE; exit;