package base::Glob;
use vars '$VERSION';
$VERSION = '0.01';
use strict;
use Text::Glob qw( match_glob );
use Devel::Symdump;
use Sub::Uplevel;
require base;
sub import {
shift;
my @packages = Devel::Symdump->rnew->packages;
uplevel 1, \&base::import,
( 'base', map { match_glob $_, @packages } @_ );
}
1;
__END__
=head1 NAME
base::Glob - Establish IS-A relationships based on globbing patterns
=head1 SYNOPSIS
package Class::Bar; sub method {2};
package Nomatch::Foo; sub method {3};
package main;
use base::Glob qw(Class::*);
print main->method(); # prints 2
=head1 DESCRIPTION
This module allows you to extend L to form IS-A relationships
with the use of globs on packages in the symbol table - in the style
of Java's 'import java.class.*;'.
=head1 DEPENDENCIES
L
L
L
=head1 BUGS
Probably.
=head1 TODO
Go all the way to Java-style by spidering to find modules to require
and add to C<@ISA>.
=head1 AUTHOR
Chris Ball, .
=head1 THANKS
Michael Schwern for L, Andreas Koenig for
L, Richard Clamp for both L and being
scary enough to work out that L would make this work.
=cut