That's for debugging purposes, to show Package::name instead of __ANON__
use Mojo::Base -strict;
use Mojo::Util 'monkey_patch';
monkey_patch Foo => foo1 => sub { Carp::carp 'hello' };
*Foo::foo2 = sub { Carp::carp 'hello' };
Foo::foo1();
Foo::foo2();
Hi All,
I am reading the source code of Mojolicious.
for sub _monkey_patch
why not just use *{"${class}::$_"} = $patch{$_} for keys %patch;
What's concern of doing this?
Best,
--
You received this message because you are subscribed to the Google
Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.