H
Hal Vaughan
I have to filter some data through a number of possible data filters. The
names of the filters are stored in a database, then loaded into a hash, so
I find the name of the needed filter like this:
$filter = $filters{$type};
$filter = \&$filter;
$data = &$filter($data);
I'd like to be able to do a 2 stage filter, one for incoming, and one for
outgoing. Most filters don't need 2 stages, but some do. I'd like to
change it to add an extra step on incoming:
$filter = $filters{$type};
$filter = $filter."incoming";
$filter = \&$filter;
$data = &$filter($data);
If I do that, is there a way to check if there is a function
"filterincoming()"? That way I could only add the "incoming" to the end if
an incoming filter actually exists, otherwise, I'd just use the regular
filter.
Is it possible to check and see if a particular functionname is available
without forcing an error?
Thanks!
Hal
names of the filters are stored in a database, then loaded into a hash, so
I find the name of the needed filter like this:
$filter = $filters{$type};
$filter = \&$filter;
$data = &$filter($data);
I'd like to be able to do a 2 stage filter, one for incoming, and one for
outgoing. Most filters don't need 2 stages, but some do. I'd like to
change it to add an extra step on incoming:
$filter = $filters{$type};
$filter = $filter."incoming";
$filter = \&$filter;
$data = &$filter($data);
If I do that, is there a way to check if there is a function
"filterincoming()"? That way I could only add the "incoming" to the end if
an incoming filter actually exists, otherwise, I'd just use the regular
filter.
Is it possible to check and see if a particular functionname is available
without forcing an error?
Thanks!
Hal