Nick Ing-Simmons wrote: > use looks for %INC entry to see if it is already loaded Ah ha! That's the ticket. For future references, this is the block of code that I added (watch wrapping): +BEGIN { + # Perl 5.005_x doesn't support lexical warnings, so we + # do the next best thing and mess with the global $SIG{__WARN__} + # handler to hide the "mandatory" warnings + if ( $] < 5.006 ) { + my $warnings = <<""; + package warnings; + # this evil^Wclever bit courtesy of Nick Ing-Simmons + \$INC{'warnings.pm'} = "inline"; + sub unimport { + shift; # ignore the package name + my \@warnings = \@_; + my \$warnregex = '('.join('|',\@warnings).')'; + \$SIG{__WARN__} = sub { warn \$_[0] unless \$_[0] =~ /\$warnregex/ }; + } + 1; + + eval $warnings; + die $@ if $@; + } +} + version-0.58 heading to a CPAN mirror near you (no substantive changes since 0.57, just a compatibility release). John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748Thread Previous | Thread Next