#!/usr/bin/perl

print "Content-type: text/html\n\n";

$file = "iam2.doc";
$found = 0;
foreach my $dir (@INC) {
    if(-e "$dir/$file") {
	$found++;
	if(open(PLIB,"$dir/$file")) {
	    print "File located at $dir/$file and opened successfully<br>\n";
	    $ret = eval("do \"$dir/$file\"");
	    if($@) {
		print "There is a compile/runtime error in $dir/$file:<br>\n$@";
	    } elsif(!$ret) {
		print "$dir/$file did not return a true value!<br>\n";
	    } else {
		print "Unable to find any problems with $dir/$file<br>\n";
	    }
	} else {
	    print "File exists, but couldn't open $dir/$file!<br>\n";
	}
    } else {
	print "$file is not in $dir<br>\n";
    }
}
if(!$found) {
    print "$file could not be found<br>\n";
}
print "Hello World<br>\n";
