Since it seems there is not going to be a quick solution to the problem of modules running under perl < 5.6 with "use warnings" (see
278753), I thought I'd add this piece of code to the snippets. Courtesy of
Podmaster. Documentation added for those monks not really familliar with BEGIN, GLOBs and %INC.
Liz
# Do this at compile time
BEGIN {
# Check if there is a warnings module available
eval {
require warnings;
# If not, create dummy "import" and "unimport" subroutines
} or do {
no strict 'refs';
*warnings::import = *warnings::unimport = sub{};
# Make sure no attempt will be made to load the "warnings.pm" file ev
+er again
$INC{'warnings.pm'} = '';
}
} #BEGIN