Next The Perl Hardware Store DC.pm Version 20

Clone the Exporter

         package Rings;
         use Carp 'croak';
         my @EXPORTS = qw(narya nenya vilya);
         my %EXPORTED = map {$_ => 1} @EXPORTS;
         sub import {
           my $pack = shift;
           my $caller = caller;
           foreach $func (@_) {
             croak "`$func' not exported" 
             unless $EXPORTED{$func};
             *{$caller . '::' . $func} = \&$func;
           }
         }


Next Copyright © 2003 M. J. Dominus