It is not required to have unique handler for each suffix. As the suffixes are just 'values' of the hash, not 'keys', so you can share handlers among suffixes. Also, you can make those handlers accept more parameters, for complex situation. | [reply] |
Actually, I was thinking that I would have to code something like:
my %handlers = ("zip" => \&zip, "zaaap" => undef, "txt" => \&txt, "ini
+" => \&misc, "foo" => \&misc, ....);
That is, if I have 50 different file types, do I need 50 different "end" => \&handler entries?
In addition, my suffixes may not be known until the script is run...
$ echo '$0 & $0 &' > foo; chmod a+x foo; foo; | [reply] [d/l] [select] |