On 05/26/2018 10:41 PM, Xin Cheng wrote:
Hi,
Why does anyone want to know the name of the sub inside the sub itself?
Is it more interesting to know the name of the calling sub?
Thanks!
Xin
Hi Xin,
This program check about 50 web sites to find new revisions
of software I need to support my
Hi,
Why does anyone want to know the name of the sub inside the sub itself?
Is it more interesting to know the name of the calling sub?
Thanks!
Xin
> On May 26, 2018, at 2:32 PM, Larry Wall wrote:
>
> On Fri, May 25, 2018 at 07:23:45PM -0700, ToddAndMargo wrote:
> : Follow up: based on Yary
On 05/26/2018 11:32 AM, Larry Wall wrote:
On Fri, May 25, 2018 at 07:23:45PM -0700, ToddAndMargo wrote:
: Follow up: based on Yary's wonderful advice, this is my keeper
: on the subject:
:
:
:
: perl6: what is the name of the subroutine you are currently in:
:
: It is:
: &?ROUTINE.name
:
On Fri, May 25, 2018 at 07:23:45PM -0700, ToddAndMargo wrote:
: Follow up: based on Yary's wonderful advice, this is my keeper
: on the subject:
:
:
:
: perl6: what is the name of the subroutine you are currently in:
:
: It is:
: &?ROUTINE.name
: callframe(0).code.name
:
: $ p6 'sub
On 05/21/2018 11:04 PM, ToddAndMargo wrote:
Hi All,
I need to know the name of the subroutine I am in.
This is the way I use to do it in Perl 5:
(my $Name = (caller(0))[3] ) ~~ s{.*::}{};
How do I do it in Perl 6?
Many thanks,
-T
Follow up: based on Yary's wonderful advice, thi
> On 22 May 2018, at 09:41, ToddAndMargo wrote:
>
> On 05/21/2018 11:21 PM, Siavash wrote:
>> https://www.nntp.perl.org/group/perl.perl6.users/2017/03/msg3423.html
>> On 2018-05-22 06:04:47 GMT, ToddAndMargo wrote:
>>> Hi All,
>>>
>>> I need to know the name of the subroutine I am in.
>>>
>>> T
On 05/22/2018 09:34 AM, Elizabeth Mattijsen wrote:
On 22 May 2018, at 09:41, ToddAndMargo wrote:
On 05/21/2018 11:21 PM, Siavash wrote:
https://www.nntp.perl.org/group/perl.perl6.users/2017/03/msg3423.html
On 2018-05-22 06:04:47 GMT, ToddAndMargo wrote:
Hi All,
I need to know the name of the
On 05/22/2018 09:09 AM, yary wrote:
Oh this works too
sub my-name-is-Sue () { say "Hi, ", &?ROUTINE.name }
my-name-is-Sue;
-y
Thank you!
> On 22 May 2018, at 09:41, ToddAndMargo wrote:
>
> On 05/21/2018 11:21 PM, Siavash wrote:
>> https://www.nntp.perl.org/group/perl.perl6.users/2017/03/msg3423.html
>> On 2018-05-22 06:04:47 GMT, ToddAndMargo wrote:
>>> Hi All,
>>>
>>> I need to know the name of the subroutine I am in.
>>>
>>> T
Oh this works too
sub my-name-is-Sue () { say "Hi, ", &?ROUTINE.name }
my-name-is-Sue;
-y
On Tue, May 22, 2018 at 8:59 AM, yary wrote:
> I was surprised there isn't a cleaner way to get a sub/method names, and
> found https://docs.perl6.org/language/5to6-perlfunc#caller
>
> Try this tasty mors
I was surprised there isn't a cleaner way to get a sub/method names, and
found https://docs.perl6.org/language/5to6-perlfunc#caller
Try this tasty morsel
who-am-i () { say "I'm ", callframe(0).code.name }
who-am-i;
-y
On Tue, May 22, 2018 at 12:41 AM, ToddAndMargo
wrote:
> On 05/21/2018 11:2
On 05/21/2018 11:21 PM, Siavash wrote:
https://www.nntp.perl.org/group/perl.perl6.users/2017/03/msg3423.html
On 2018-05-22 06:04:47 GMT, ToddAndMargo wrote:
Hi All,
I need to know the name of the subroutine I am in.
This is the way I use to do it in Perl 5:
(my $Name = (caller(0))
https://www.nntp.perl.org/group/perl.perl6.users/2017/03/msg3423.html
On 2018-05-22 06:04:47 GMT, ToddAndMargo wrote:
> Hi All,
>
> I need to know the name of the subroutine I am in.
>
> This is the way I use to do it in Perl 5:
>
> (my $Name = (caller(0))[3] ) ~~ s{.*::}{};
>
> How do I
Hi All,
I need to know the name of the subroutine I am in.
This is the way I use to do it in Perl 5:
(my $Name = (caller(0))[3] ) ~~ s{.*::}{};
How do I do it in Perl 6?
Many thanks,
-T
14 matches
Mail list logo