Yes. That is what I tried to write :-)
On Thursday, December 18, 2014 12:41:39 AM UTC+1, Charlie Brady wrote:
On Wed, 17 Dec 2014, Jan Henning Thorsen wrote:
Pavel, you can do this:
my $b = __PACKAGE__-can($a);
$b-(stuff) if $code;
I guess you mean:
$b-(stuff) if $b;
--
Pavel, you can do this:
my $b = __PACKAGE__-can($a);
$b-(stuff) if $code;
You can replace __PACKAGE__ with whatever package name you want.
The special symbol __PACKAGE__ contains the current package,
can() returns a ref to a function/method if $a has the correct method name
which can be found
On Wed, 17 Dec 2014, Jan Henning Thorsen wrote:
Pavel, you can do this:
my $b = __PACKAGE__-can($a);
$b-(stuff) if $code;
I guess you mean:
$b-(stuff) if $b;
Hi everyone,
I need to pass as input parameter of one function name of other function
which must be executed in some cases. But cause of Mojolicious uses 'strict
refs' I have no idea how to do it :(
Can you please advice me something?
For better understanding problem let me give an example:
пятница, 12 декабря 2014 г. пользователь Pavel Serikov написал:
Hi everyone,
I need to pass as input parameter of one function name of other function
which must be executed in some cases. But cause of Mojolicious uses 'strict
refs' I have no idea how to do it :(
Can you please advice me
http://perldoc.perl.org/strict.html
Maybe no strict 'refs' before you code and strict 'refs' after
пятница, 12 декабря 2014 г. пользователь Денис Ильиных написал:
пятница, 12 декабря 2014 г. пользователь Pavel Serikov написал:
Hi everyone,
I need to pass as input parameter of one function
http://perldoc.perl.org/strict.html
Maybe no strict 'refs' before you code and strict 'refs' after
This is not good advice, i believe you should have good reasons for
deactivating strict and warnings.
--
sebastian
--
You received this message because you are subscribed to the Google
This is not good advice, i believe you should have good reasons for
deactivating strict and warnings.
And the real question that needs to be answered first is What are you
actually trying to achieve?.
If you want to work with subroutines as if they were references, just use
subroutine
Hi Sebastian,
Thank you very much.
Actually working solution is:
my $a = test;
sub test {
print Hello World!\n;
}
my $b = \$a;
$b-();
I hope that this code is considered as good style :)
And the real question that needs to be answered first is What are you
actually trying to achieve?.