Perl include errors

Here is the work around code for perl/cgi scripts that contain a "require" statement for a include ie; @inc.
This will now work with perl.dll and/or perl.exe


1. Replace the single line "require = "yourfile.cgi";

2. with:

if( $ENV{'SERVER_SOFTWARE'} =~ /IIS/ ) {
$yyIIS = 1;
$0 =~ m~(.*)(\\|/)~;
$yypath = $1;
$yypath =~ s~\\~/~g;
chdir($yypath);
push(@INC,$yypath);
}

use CGI qw(header cookie);
$CGI::HEADERS_ONCE = 1;
require "yourfile.cgi";

Add Feedback