On Tue, 11 Jan 2022 at 10:18, Yamadaえりな <yamoer...@gmail.com> wrote:

> So, I would like to ask another question:
> Is it safe to pass function reference to the caller (mostly it's the
> method instantized from a class) in mod_perl development env?
> Or should I avoid using this style?
>

Nothing wrong with passing code refs at all. It is common. Some folks
prefer to pass *named* subroutines instead of anoymous ones. Eg:

$thing->method(sub { "whatever" });

might turn into

sub whatever {
   "whatever";
}

$thing->method(\&whatever);

this style will produce more comprehensible and easy to debug error
messages. But tons of folks dont bother.

Good luck.

Yves

Reply via email to