in reply to Re: a few clarifications
in thread Win32 Hosting companies not supporting Perl
Save and run the script in your browser from IIS, not form the command prompt. Then when it's eating up your CPU quickly open task manager and try to end the process. You'll see that it won't let you (on win2000 at least). The app should die after 30 seconds from the Alarm() setting at the top. Now if you want to see it take down IIS, remove the Alarm() code, run from your browser and click the stop button. Viola IIS is crippled, this is where most WinDose hosts will reach for the reset switch. And heres the best bit, when the machine reboots and is available again the happless user, wondering what the problem is hit's the refresh button and viola, IIS is crippled. After several reboots and very pissed off WinDose hosting company understandable says "I don't get this problem with ASP or PHP, I'm going to remove Perl, it's not worth the effort."alarm 30; $|=1; ## Choose operating system BEGIN { if (($^O eq 'MSWin32') || defined($ENV{'OS'})) { $operatingsystem = 0; $operatingsystemoldnt = 0; $systempath = "$ENV{'PATH_TRANSLATED'}"; $systempath =~ s/(\\[a-z0-9]*\.pl)$//g; unless ($systempath) { $systempath = "$ENV{'SCRIPT_FILENAME'}"; $systempath =~ s/(\/[a-z0-9]*\.pl)$//g; } ## End unless # $operatingsystemoldnt = 1; # $slash = '\\'; $slash = '/'; } ## End if else { $operatingsystem = 1; $systempath = "$ENV{'SCRIPT_FILENAME'}"; $systempath =~ s/(\/[a-z0-9]*\.pl)$//g; if ($systempath =~ /cgiwrap/) { $systempath = "$ENV{'PATH_TRANSLATED'}"; $systempath =~ s/(\/[a-z0-9]*\.pl)$//g; } ## End if $slash = '/'; } ## End else ## $systempath = "systempath to your folder"; ## Enter the correct val +ue and un-comment this if you are having system path detection proble +ms push (@INC, "$systempath"); } ## End BEGI print "Content-type:text/html\n\n"; ## Directory navigator $directorypath = "c:/"; my @directories; my @variables; my $directoryname = 1; push (@directories,"$directorypath"); until ($directoryname eq "rerasfsdfsdfsdf") { $directoryname = shift (@directories); chomp($directoryname); opendir(CURRENTDIR, "$directoryname"); @dirfiles = readdir (CURRENTDIR); closedir(CURRENTDIR); foreach $filename (@dirfiles) { chomp($filename); unless ($filename eq "." || $filename eq "..") { if (-d "$directoryname/$filename") { push (@directories,"$directoryname/$filename"); print "$directoryname/$filename\n"; } ## End if } ## End unless } ## End loop } ## End loop
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: a few clarifications
by gellyfish (Monsignor) on Nov 02, 2004 at 15:02 UTC | |
| |
|
Re^3: a few clarifications
by hostyle (Scribe) on Nov 02, 2004 at 15:16 UTC | |
| |
|
Re^3: a few clarifications
by gellyfish (Monsignor) on Nov 02, 2004 at 17:20 UTC | |
|