in reply to Re^2: passing regular expression
in thread passing regular expression

I don't think that's possible for non-builtin functions. If it is, it might work with a prototype, see perlsub.