Re: EVAL?

2018-06-13 Thread Todd Chester
On Wed, 13 Jun 2018 15:23:56 -0700 yary wrote > Pet peeve, "$RunSpecific" with the quotes on either side is exactly the same as $RunSpecific without the quotes. Perl isn't shell. > > -y Hi Yary, Chuckle. Missed one. What?? Or two or three ... This program that I have been

Re: EVAL?

2018-06-13 Thread Elizabeth Mattijsen
It is in this situation, but not necessarily always: “$foo” is equivalent to $foo.Str $foo is exactly what $foo is. my $foo = 42;:wq dd $foo; # Int $foo = 42 dd “$foo” # “42" > On 14 Jun 2018, at 00:23, yary wrote: > > Pet peeve, "$RunSpecific" with the quotes on either side is

Re: EVAL?

2018-06-13 Thread yary
Pet peeve, "$RunSpecific" with the quotes on either side is exactly the same as $RunSpecific without the quotes. Perl isn't shell. -y On Wed, Jun 13, 2018 at 12:27 PM, Brandon Allbery wrote: > Exactly what it says: eval is a code injection attack waiting to happen. > If you actually need it,

Re: EVAL?

2018-06-13 Thread Brandon Allbery
Exactly what it says: eval is a code injection attack waiting to happen. If you actually need it, you get to do your own data sanitization, and you tell Perl 6 you did so with "use MONKEY-SEE-NO-EVAL;". On Wed, Jun 13, 2018 at 3:22 PM ToddAndMargo wrote: > Hi All, > > I am converting a program

EVAL?

2018-06-13 Thread ToddAndMargo
Hi All, I am converting a program from Perl5 to Perl 6. This line else { eval "$RunSpecific"; } became this line else { EVAL "$RunSpecific"; } And threw this error $ perl6 -c GetUpdates.pl6 ===SORRY!=== Error while compiling /home/linuxutil/GetUpdates.pl6 EVAL is a very dangerous

Re: How do I remove leading zeros?

2018-06-13 Thread Brandon Allbery
https://docs.perl6.org/language/regexes#Capture_markers:_%3C(_)%3E On Wed, Jun 13, 2018 at 3:10 PM Xin Cheng wrote: > Now we know the meaning of >> and <<. But what about <( and )> ? What do > they mean here? > > Thanks. > Xin > > On Jun 13, 2018, at 2:18 PM, Brad Gilbert wrote: > > On Wed,

Re: How do I remove leading zeros?

2018-06-13 Thread Xin Cheng
Now we know the meaning of >> and <<. But what about <( and )> ? What do they mean here? Thanks. Xin > On Jun 13, 2018, at 2:18 PM, Brad Gilbert wrote: > > On Wed, Jun 13, 2018 at 1:09 PM ToddAndMargo > wrote: >> >> On 06/13/2018 11:06 AM, ToddAndMargo wrote:

Re: How do I remove leading zeros?

2018-06-13 Thread ToddAndMargo
On 06/13/2018 11:18 AM, Brad Gilbert wrote: On Wed, Jun 13, 2018 at 1:09 PM ToddAndMargo wrote: On 06/13/2018 11:06 AM, ToddAndMargo wrote: On 06/13/2018 11:03 AM, ToddAndMargo wrote: On 06/13/2018 11:00 AM, Larry Wall wrote: $ p6 'my $x = "01.000.103.006.10"; $x ~~ s:g/«0+)>\d//;

Re: How do I remove leading zeros?

2018-06-13 Thread Brad Gilbert
On Wed, Jun 13, 2018 at 1:09 PM ToddAndMargo wrote: > > On 06/13/2018 11:06 AM, ToddAndMargo wrote: > > On 06/13/2018 11:03 AM, ToddAndMargo wrote: > >> On 06/13/2018 11:00 AM, Larry Wall wrote: > > > $ p6 'my $x = "01.000.103.006.10"; $x ~~ s:g/«0+)>\d//; say "$x"' > > 1.0.103.6.10 > >

Re: How do I remove leading zeros?

2018-06-13 Thread Brandon Allbery
https://docs.perl6.org/language/unicode_entry I have right Alt set as my Compose key, so it'd be [right-Alt] < < (At some point I should see if I can put in some information about WinCompose, since I think I'm currently the only one with any experience with it.) On Wed, Jun 13, 2018 at 2:09 PM

Re: How do I remove leading zeros?

2018-06-13 Thread ToddAndMargo
On 06/13/2018 11:06 AM, ToddAndMargo wrote: On 06/13/2018 11:03 AM, ToddAndMargo wrote: On 06/13/2018 11:00 AM, Larry Wall wrote:    $ p6 'my $x = "01.000.103.006.10"; $x ~~ s:g/«0+)>\d//; say "$x"'    1.0.103.6.10 Hi Larry, How did you get thee "«" character to appear? And what

Re: How do I remove leading zeros?

2018-06-13 Thread ToddAndMargo
On 06/13/2018 11:03 AM, ToddAndMargo wrote: On 06/13/2018 11:00 AM, Larry Wall wrote: I'd probably just write something like: s:g { « <( 0+ )> \d+ » } = ''; The first <( and the last » are not strictly necessary, but add clarity, or at least balance.  But in golf mode you could get away

Re: How do I remove leading zeros?

2018-06-13 Thread ToddAndMargo
On 06/13/2018 11:00 AM, Larry Wall wrote: I'd probably just write something like: s:g { « <( 0+ )> \d+ » } = ''; The first <( and the last » are not strictly necessary, but add clarity, or at least balance. But in golf mode you could get away with something like: sg/«0+)>\d//;

Re: How do I remove leading zeros?

2018-06-13 Thread ToddAndMargo
On 06/12/2018 10:22 PM, Norman Gaywood wrote: On Wed, 13 Jun 2018 at 14:57, ToddAndMargo > wrote: I am trying to turn      01.02.03 into      1.2.3 What am I doing wrong, this time? $ p6 'my $x="01.02.03"; $x ~~ s:global/"0"(\d)/ $0

Re: How do I remove leading zeros?

2018-06-13 Thread Larry Wall
I'd probably just write something like: s:g { « <( 0+ )> \d+ » } = ''; The first <( and the last » are not strictly necessary, but add clarity, or at least balance. But in golf mode you could get away with something like: sg/«0+)>\d//; Larry

Re: How do I remove leading zeros?

2018-06-13 Thread Mark Senn
If $x is set to "01.02.03" (Not using normal message quoting to make message shorter. [1] ToddAndMargo[2] Norman Gaywood[3] Mark Senn) DOING $x ~~ s:global/"0"(\d)/ $0 /; [1] SETS $x TO"1 . 2 . 3"[1]