perl BOFH :)

Hello,

This is a script that a friend of mine wrote, and I just added some things on the code, it's intended to be funny :smiley: Please excuse me if it had been posted somewhere here, i wasn't able to find it. I'm using this as a 404 document.

The code :

#!/usr/local/bin/perl
# BOFH exuse generator

@first = qw (
Temporary Intermittant Partial Redundant Total Multiplexed Inherent Duplicated D
ual-Homed
Synchronous Bidirectional Serial Asynchronous Multiple Replicated Non-Replicated
 Unregistered
Non-Specific Generic Migrated Localised Resignalled Dereferenced Nullified Abort
ed Serious SystemBus
Minor Major Extraneous Illegal Insufficient Viral Unsupported Outmoded Legacy Pe
rmanent Subfailure
Invalid Deprecated Virtual Unreportable Undetermined Undiagnosable Unfiltered St
atic Dynamic
Delayed Immediate Nonfatal Fatal Non-Valid Unvalidated Non-Static Unreplicatable
 Non-Serious
);

@second = qw(
Array Systems Hardware Software Firmware Backplane Logic-Subsystem Integrity Sub
system Memory
Comms Integrity Checksum Protocol Parity Bus Timing Synchronisation Topology Tra
nsmission Reception
Stack Framing Code Programming Peripheral Environmental Loading Operation Parame
ter Syntax Initialisation
Execution Resource Encryption Decryption File Precondition Authentication Paging
 Swapfile Service Gateway
Request Proxy Media Registry Configuration Metadata Streaming Retrieval Installa
tion Library Handler
);

@third = qw(
Interruption Destabilisation Destruction Desynchronisation Failure Dereferencing
 Overflow Underflow NMI
Interrupt Corruption Anomaly Seizure Override Reclock Rejection Invalidation Hal
t Exhaustion Infection
Incompatibility Timeout Expiry Unavailability Bug Condition Crash Dump Crashdump
 Stackdump Problem Lockout
Untransmittable Panic CrashOverride Impossibillity Defacement Desegmentation
);

@fourth = qw(
Error Problem Warning Signal Flag
);

sub get_exuse() {
        my $exuse;
        $exuse .= $first[rand($#first)].' ';
        $exuse .= $second[rand($#second)].' ';
        $exuse .= $third[rand($#third)];
        $exuse .= ' '.$fourth[rand($#fourth)] if (rand(10) % 2==0);
        return $exuse;
}

print "Content-type: text/html\n\n";
print "<h2>You came here because:</h2>\n";
print "<h3>Today's excuse: <u>".&get_exuse."</u></h3>\n";
print "<b>In case the above is not good try one of these:</b><br><br>\n";
for ($i=0;$i<10;$i++) {
        print &get_exuse . "<br>\n";
}