But the problem is that in the current form, all output comes from one pattern match. The base sub has to return either $a or $b, $pathname or $filename; if I use wrapping subs, I still loose the context.
Unless ofcourse I add an extra parameter that specifies whether I'm interested in the pathname or the filename, but then I don't need the wrapping subs either.
I could make seperate subs obviously, but then I would have to duplicate the same pattern matching, and that wouldn't be much fun training-wise, would it. ;)