home *** CD-ROM | disk | FTP | other *** search
/ CGI How-To / CGI HOW-TO.iso / chap2 / 2_4 / testgway.pl < prev    next >
Encoding:
Perl Script  |  1996-06-15  |  598 b   |  30 lines

  1. #!/usr/bin/perl
  2.  
  3. # Access the environment variable by name
  4.  
  5. $gateway_interface = $ENV{'GATEWAY_INTERFACE'};
  6.  
  7. #  Send the output mime type to the server to know what output to handle
  8.  
  9. print "Content-type: text/plain\n\n";
  10.  
  11. # Split the information into name/revision strings
  12. # by splitting on the slash character.
  13.  
  14. ($name,$revision) = split('/', $gateway_interface, 2);
  15.  
  16. # Test and print the information if defined.
  17.  
  18. if ($name && $revision)
  19. {
  20.     print "Gateway Interface: name = $name revision = $revision\n";
  21. }
  22. else
  23. {
  24.     print "Gateway interface is undefined or invalid!\n";
  25. }
  26.  
  27. #
  28. # end of testgway.pl
  29. #
  30.