March 2002 | Perl Hardware Store | 16 |
Your module provides
package MyModule;
sub no_elements { ... }
Later you realize that num_elements would have been clearer
package MyModule;
sub num_elements { ... } BEGIN { *no_elements = \&num_elements; }
Now both names will do exactly the same thing
You can change the documentation to say
num_elements Returns the number of pending items in the flapdoodle queue
no_elements Obsolete synonym for 'num_elements'
Similarly
sub unimplemented { ... } for (qw(FIRSTKEY NEXTKEY CLEAR)) { *$_ = \&unimplemented; }
Next | Copyright © 2002 M-J. Dominus |