March 2002 Perl Hardware Store 16

2. Manual Importing and Exporting

Provide a synonym for a function

        package MyModule;
        sub no_elements { ... }
        package MyModule;
        sub num_elements { ... }
        BEGIN { *no_elements = \&num_elements; }
        num_elements    Returns the number of pending items in the
                        flapdoodle queue
        no_elements     Obsolete synonym for 'num_elements'
        sub unimplemented { ... }
        for (qw(FIRSTKEY NEXTKEY CLEAR)) {
          *$_ = \&unimplemented;
        }


Next Copyright © 2002 M-J. Dominus