Re: What is my sub?

2018-05-22 Thread Elizabeth Mattijsen
> 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

Re: What is my sub?

2018-05-22 Thread ToddAndMargo
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

Re: What is my sub?

2018-05-22 Thread ToddAndMargo
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!

Re: What is my sub?

2018-05-22 Thread Elizabeth Mattijsen
> 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

Re: What is my sub?

2018-05-22 Thread yary
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

Re: What is my sub?

2018-05-22 Thread yary
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

Re: What is my sub?

2018-05-22 Thread ToddAndMargo
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))