/usr/share/perl5/Class/WhiteHole.pm is in libclass-whitehole-perl 0.04-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | # $Id: WhiteHole.pm,v 1.4 2001/02/07 11:42:37 schwern Exp $
package Class::WhiteHole;
require 5;
use strict;
use vars qw(@ISA $VERSION $ErrorMsg);
$VERSION = '0.04';
@ISA = ();
# From 5.6.0's perldiag.
$ErrorMsg = qq{Can\'t locate object method "%s" via package "%s" }.
qq{at %s line %d.\n};
=pod
=head1 NAME
Class::WhiteHole - base class to treat unhandled method calls as errors
=head1 SYNOPSIS
package Bar;
# DBI inherits from DynaLoader which inherits from AutoLoader
# Bar wants to avoid this accidental inheritance of AutoLoader.
use base qw(Class::WhiteHole DBI);
=head1 DESCRIPTION
Its possible to accidentally inherit an AUTOLOAD method. Often this
will happen if a class somewhere in the chain uses AutoLoader or
defines one of their own. This can lead to confusing error messages
when method lookups fail.
Sometimes you want to avoid this accidental inheritance. In that
case, inherit from Class::WhiteHole. All unhandled methods will
produce normal Perl error messages.
=head1 BUGS & CAVEATS
Be sure to have Class::WhiteHole before the class from which you're
inheriting AUTOLOAD in the ISA. Usually you'll want Class::WhiteHole
to come first.
If your class inherits autoloaded routines this class may cause them
to stop working. Choose wisely before using.
White holes are only a hypothesis and may not really exist.
=head1 COPYRIGHT
Copyright 2000 Michael G Schwern <schwern@pobox.com> all rights
reserved. This program is free software; you can redistribute it
and/or modify it under the same terms as Perl itself.
=head1 AUTHOR
Michael G Schwern <schwern@pobox.com>
=head1 SEE ALSO
L<Class::BlackHole>
=cut
sub AUTOLOAD {
my($proto) = shift;
my($class) = ref $proto || $proto;
my($meth) = $Class::WhiteHole::AUTOLOAD =~ m/::([^:]+)$/;
return if $meth eq 'DESTROY';
my($callpack, $callfile, $callline) = caller;
die sprintf $ErrorMsg, $meth, $class, $callfile, $callline;
}
1;
|