in reply to Re^2: efficient function
in thread efficient function

Ikegami, a most excellent post!

However, I suspect that OP doesn't need either exec() or fork(), but of course we can't know that without further clarification.

For the OP, there is no need for these in a normal single Perl program as there are modules and functions that can usually do what you need, and much more efficiently.