#! /usr/bin/perl -w package PSI::ESP; use strict; # array of reasons why a script might fail my @reasons = ( "You can't hide the source of a Perl script by compiling it, nor would you want to.", "perldoc -q round will tell you about rounding numbers", "The -i switch will let you edit a file in place. perldoc -q 'how do i change one line in a file'", "Writing a program that prints itself has been done. http://www.nyx.net/~gthompso/quine.htm", "HTML can't be parsed with simple regular expressions. Use HTML::Parser.", "Exporter can't export private (lexical or package) variables.", "You can use the OLE modules to open/read/write to Excel files.", "OOP tutorials: perldoc perltoot/perlboot/perlobj/perlbot", "Use length() for the number of characters in a string.", "That's in the FAQ", ); # this class can only be created with no constructor parameters sub new { my $classname = shift @_; # read the OOP tutorials for information on bless/new and OOP bless { _classname => $classname }, $classname; } # get a random reason sub reason() { # rand will return a random number between 0 and its parameter # thus, we will produce a random reason from the @reasons array # every time return $reasons[rand @reasons]; } 1;