Re: What is my sub?

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

Re: What is my sub?

2018-05-26 Thread Xin Cheng
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

Re: What is my sub?

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

Re: my keeper on random numbers

2018-05-26 Thread ToddAndMargo
On 05/26/2018 09:22 PM, ToddAndMargo wrote: Why the caret in `0..^1000`?  Why not `0..1000`? Figured that one out. The caret means to exclude the last number, so `0..^1000` is the same as `0..999` Thank you!

Re: my keeper on random numbers

2018-05-26 Thread ToddAndMargo
On 05/26/2018 09:09 PM, Brad Gilbert wrote: On Sat, May 26, 2018 at 10:59 PM, ToddAndMargo wrote: On 05/26/2018 05:10 AM, Brian Duggan wrote: To convert to an positive integer, use truncate: $ p6 'say 1000.rand.truncate;' 876 or use pick: perl6 -e 'say

Re: my keeper on random numbers

2018-05-26 Thread Brad Gilbert
On Sat, May 26, 2018 at 10:59 PM, ToddAndMargo wrote: > On 05/26/2018 05:10 AM, Brian Duggan wrote: >>> >>> To convert to an positive integer, use truncate: >>> $ p6 'say 1000.rand.truncate;' >>> 876 >> >> >> or use pick: >> >> perl6 -e 'say (^1000).pick' >> 209

Re: my keeper on random numbers

2018-05-26 Thread ToddAndMargo
On 05/26/2018 05:10 AM, Brian Duggan wrote: To convert to an positive integer, use truncate: $ p6 'say 1000.rand.truncate;' 876 or use pick: perl6 -e 'say (^1000).pick' 209 Brian Hi Brian, What does (^1000) mean? -T

Re: What is my sub?

2018-05-26 Thread Larry Wall
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

Re: my keeper on random numbers

2018-05-26 Thread Brian Duggan
> To convert to an positive integer, use truncate: > $ p6 'say 1000.rand.truncate;' > 876 or use pick: perl6 -e 'say (^1000).pick' 209 Brian