NAME
Sub::Approx - Perl extension for blah blah blah
SYNOPSIS
use Sub::Approx;
sub a {
# blah...
}
&aa; # executes &a if &aa doesn't exist.
DESCRIPTION
This is _really_ stupid. This module allows you to call functions by _approximate_ names. Why you would ever want to do this is a complete mystery to me. It was written as an experiment to see how well I understood typeglobs and AUTOLOADing.
To use it, simply include the line:
use Sub::Approx;
somewhere in your program. Then each time you call a function that doesn't exist in the the current package Perl will search for a function with approximately the same name. Currently 'approximately' means 'with the same soundex value as generated by Text::Soundex' - but this may change (or even become configurable). If more than one function is found that matches, then one is chosen at random.
I can't stress too strongly that this will make your code completely unmaintainable and you really shouldn't use this module unless you're doing something very stupid.
ACKNOWLEDGEMENTS
This idea came to me whilst sitting in Mark-Jason Dominus' "Tricks of the Wizards" tutorial. In order to protect his reputation I should probably point out that just as the idea was forming in my head he clearly said that this kind of thing was a very bad idea.
AUTHOR
Dave Cross <dave@dave.org.uk>
SEE ALSO
perl(1).