August 1999 Perl Hardware Store Slide #12

A Module That Exports a Function

         # If you subclass this package, it will
         # export the overriden `foo' from the
         # subclass, if there is one.
         sub import {
           my $package = shift;
           my $caller = caller;
           *{$caller . '::foo'} = $package->can('foo');
         }


Next Copyright © 1998 M-J. Dominus