in reply to Re: Passing results of a substitution to a function
in thread Passing results of a substitution to a function
This seems to work quite nicely - but needs a small amount of tweaking to make sure grep doesn't return stuff in scalar context.