-my $blosxom_cgi = "$testdir/../../blosxom.cgi";
-die "cannot find blosxom.cgi '$blosxom_cgi'" unless -f $blosxom_cgi;
+my $blosxom_cgi = $ENV{BLOSXOM_CGI};
+unless ($blosxom_cgi && -f $blosxom_cgi) {
+ if (-f "$testdir/../../blosxom.cgi") {
+ $blosxom_cgi = "$testdir/../../blosxom.cgi";
+ warn "ignoring BLOSXOM_CGI setting '$ENV{BLOSXOM_CGI}' - using '$blosxom_cgi' instead"
+ if $ENV{BLOSXOM_CGI};
+ }
+ elsif ($blosxom_cgi) {
+ die "cannot find blosxom.cgi '$blosxom_cgi' - check your BLOSXOM_CGI environment variable";
+ }
+ else {
+ die "cannot find blosxom.cgi - please set the BLOSXOM_CGI environment variable";
+ }
+}