in reply to why use a coderef?

The usual reason is to provide flexibility to allow code reuse.

For example, consider sort. Specify a coderef allows us to use sort to sort by any criteria. Without the coderef, we'd have to have one function to sort lexically, another to sort numerically, etc. It saves us from writing many similar functions.