Next Tricks of the Wizards 18

Exportation

        package Cookout;
        sub import {
          my $caller = caller;
         *{$caller . '::grill'} = \&grill;
        }
        sub grill { 
          ...
        }
        use Cookout;       # Calls Cookout->import()
        grill('kebabs');   # Calls Cookout::grill('kebabs')



Next Copyright © 2003 M. J. Dominus