Your hash of coderefs is generally called a dispatch table in perl. It's an excellent choice, and a popular enough idiom to cause no confusion.
You may want to look into PerlIO::via, which addresses just your problem - preprocessing file I/O. It permits setting the processing scheme within the open mode argument, or with binmode.
After Compline,
Zaxo
In reply to Re: Implementing filters as callbacks / hashrefs / regexes
by Zaxo
in thread Implementing filters as callbacks / hashrefs / regexes
by clinton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |