#! /usr/bin/perl ############################################# # check.cgi # Version 1.0 # 1/23/2004 # (c) Vendercom 2004 # NOTICE: This script is free for use by anyone. # Copyright notices and links remain intact. # ------------------------------------------- # Vendercom # support@vendercom.com # http://www.vendercom.com ############################################# ############## # HOW TO USE # ############## $script_cgi = "abc.cgi"; # 1. Enter the correct name of your CGI script to check. # Please make sure to place this script in the same directory as $script_cgi . # # 2. The first line of the script is your path to perl. # It must be correct in order for the script to function. # @ Vendercom => /usr/bin/perl # # 3. Upload the script to the directory where you have # premission to run cgi scripts. # @ Vendercom => /home/yourusername/cgi-bin # # 4. Set the file permissions to 755. # # 5. Run the script from your web browser. ############################################# # No changes needed below this line $script_check = (split(/\\|\/|\:/,$0))[-1]; open(CHECK,$script_cgi) || &script_error ("Not found: $script_cgi."); while(){ last if /^__END__[\r\n]+$/; $script_perl .= $_; } close(CHECK); $script_perl =~ s/$script_cgi/$script_check/g; eval $script_perl; &script_error ("Content-type: text/html\n\n ERROR: $script_cgi
ERROR!

$script_cgi $@") if $@ ne ""; exit; sub script_error{ print "$_[0]\n"; print "$]\n"; print "

\n"; print "\n"; while (($v1, $v2) = each %ENV) { print "\n"; } print "
$v1$v2
\n"; print "

\n"; print "©2004 - Vendercom Web Hosting and eCommerce Solutions All rights reserved.\n"; print "
\n"; print "\n"; print "\n"; exit; } 1; __END__