Re: how do I match the next two characters?

2018-01-22 Thread ToddAndMargo
On Fri, Jan 19, 2018 at 12:29 AM, Todd Chester > wrote: On 01/18/2018 05:17 PM, mimosinnet wrote: The '?' is not necessary Indeed! I use `.*?` when I do not want the wild card to be "greedy" When I have a choice of using either, I a

Re: how do I match the next two characters?

2018-01-18 Thread Todd Chester
On 01/18/2018 05:17 PM, mimosinnet wrote: The '?' is not necessary Indeed! I use `.*?` when I do not want the wild card to be "greedy" When I have a choice of using either, I always use `.*?` so I remember the difference and as a kind of comment that tells me not to be greedy. Thank you!

Re: how do I match the next two characters?

2018-01-18 Thread Andy Bach
>The '?' is not necessary ;-) perl6 -e 'my $x="abcsdd1efg1234xyz"; $x ~~ m/(sd..).*(12..)/; say "$0, $1"' sdd1, 1234 The "?" is to modify the "*" to be "non-greedy" - that is, it will match the first chunk of stuff that is followed by whatever is after it (so, "/*?/" the "?" is certainly unne

Re: how do I match the next two characters?

2018-01-18 Thread mimosinnet
Thanks for this thread El Tuesday, 16 de January del 2018 a les 19:28, Todd Chester va escriure: But I do have to use `.*?` in the middle when matching two things $ perl6 -e 'my $x="abcsdd1efg1234xyz"; $x ~~ m/(sd..).*?(12..)/; say "$0, $1"' sdd1, 1234 The '?' is not necessary ;-) perl6 -

Re: how do I match the next two characters?

2018-01-16 Thread Todd Chester
On 01/16/2018 12:57 AM, Elizabeth Mattijsen wrote: On 16 Jan 2018, at 09:46, ToddAndMargo wrote: I want to match the next two character (don't care what they are) in the following I will use ?? for the next two character, but that doesn't work $x ~~ m/.*?(sd??).*/; I want $0

Re: how do I match the next two characters?

2018-01-16 Thread ToddAndMargo
On 01/16/2018 12:57 AM, Elizabeth Mattijsen wrote: On 16 Jan 2018, at 09:46, ToddAndMargo wrote: I want to match the next two character (don't care what they are) in the following I will use ?? for the next two character, but that doesn't work $x ~~ m/.*?(sd??).*/; I want $0 to i

Re: how do I match the next two characters?

2018-01-16 Thread Elizabeth Mattijsen
> On 16 Jan 2018, at 09:46, ToddAndMargo wrote: > I want to match the next two character (don't care what > they are) in the following > > I will use ?? for the next two character, but that doesn't work > $x ~~ m/.*?(sd??).*/; > > I want $0 to include th

how do I match the next two characters?

2018-01-16 Thread ToddAndMargo
Hi All, I want to match the next two character (don't care what they are) in the following I will use ?? for the next two character, but that doesn't work $x ~~ m/.*?(sd??).*/; I want $0 to include the "sd" and the next two characters, whatever they are. Many thanks, -T

Re: next

2017-06-19 Thread Andy Bach
On Mon, Jun 19, 2017 at 11:35 AM, Brad Gilbert wrote: > Instead of a `continue` block after the loop, there is a `NEXT` phaser > inside the block > ah, thanks (though the term "phaser" (outside of "set on stun", of course) is new) and that can be block too: https:/

Re: next

2017-06-19 Thread Brad Gilbert
On Mon, Jun 19, 2017 at 11:15 AM, Andy Bach wrote: > > On Fri, Jun 16, 2017 at 11:11 PM, Gabor Szabo wrote: >> >> If the loop has some action and a condition it will jump to execute >> the action again (increment $i) and check the condition and act >> according

Re: next

2017-06-19 Thread Andy Bach
On Fri, Jun 16, 2017 at 11:11 PM, Gabor Szabo wrote: > If the loop has some action and a condition it will jump to execute > the action again (increment $i) and check the condition and act > accordingly doing the next iteration or quitting the loop. > Just checking but there are

Re: next

2017-06-18 Thread ToddAndMargo
On Sun, Jun 18, 2017 at 11:41 PM, ToddAndMargo > wrote: On 06/17/2017 12:22 AM, yary wrote: last if ++$true_count == 6; Hi Yary, ++$true_count Is that the same as `$true_count + 1` ? And does it alter the value of $true_count? -

Re: next

2017-06-18 Thread Brandon Allbery
On Mon, Jun 19, 2017 at 12:41 AM, ToddAndMargo wrote: > On 06/17/2017 12:22 AM, yary wrote: > >> last if ++$true_count == 6; >> > > ++$true_count > > Is that the same as `$true_count + 1` ? > > And does it alter the value of $true_count > Yes and yes, just like in C and Perl 5; note that being p

Re: next

2017-06-18 Thread Stephen Wilcoxon
In this instance, it is the same as "$true_count = $true_count + 1". ++$var and $var++ differ if they are used in an assignment or other operation. For instance: my $x = 1; my $y = ++$x; # $x is incremented before assignment my $z = $x++; # $x is incremented after assignment At the end, $x = 3

Re: next

2017-06-18 Thread ToddAndMargo
On 06/17/2017 12:22 AM, yary wrote: last if ++$true_count == 6; Hi Yary, ++$true_count Is that the same as `$true_count + 1` ? And does it alter the value of $true_count? -T

Re: next

2017-06-18 Thread ToddAndMargo
On 06/16/2017 09:11 PM, Gabor Szabo wrote: I probably would not say "restart" the loop. It goes to the*next* iteration of the loop: I used "restart" because I wanted myself to think it went back to the top, ignoring everything else in the {} and proceeded to the next item

Re: next

2017-06-17 Thread yary
On Fri, Jun 16, 2017 at 11:11 PM, Gabor Szabo wrote: > I probably would not say "restart" the loop. > > There is a statement for that, "redo" restarts the loop without updating the value. my $true_count = 0; loop (my $i = 1; $i < 10; $i++) { last if ++$true_count == 6; say "\$true_count==$true

Re: next

2017-06-16 Thread Gabor Szabo
On Sat, Jun 17, 2017 at 4:19 AM, ToddAndMargo wrote: > On 06/16/2017 06:08 PM, Brandon Allbery wrote: >> >> On Fri, Jun 16, 2017 at 9:02 PM, ToddAndMargo > <mailto:toddandma...@zoho.com>> wrote: >> >> I am afraid I am not understanding "next"

Re: next

2017-06-16 Thread ToddAndMargo
On 06/16/2017 06:08 PM, Brandon Allbery wrote: On Fri, Jun 16, 2017 at 9:02 PM, ToddAndMargo <mailto:toddandma...@zoho.com>> wrote: I am afraid I am not understanding "next" again. When you invoke it, does it pop you back at the start of the loop or just coug

Re: next

2017-06-16 Thread Brandon Allbery
On Fri, Jun 16, 2017 at 9:02 PM, ToddAndMargo wrote: > I am afraid I am not understanding "next" again. > > When you invoke it, does it pop you back at the start of > the loop or just cough up the next value? > The former. Or you can think of it as jumping past everyth

next

2017-06-16 Thread ToddAndMargo
Hi All, I am afraid I am not understanding "next" again. When you invoke it, does it pop you back at the start of the loop or just cough up the next value? Many thanks, -T -- ~~~ Serious error. All shortcuts have disappeared. Screen. Mind. Both are blank. ~~~

Re: need help with "next"

2017-05-24 Thread ToddAndMargo
On 05/24/2017 01:04 AM, Richard Hainsworth wrote: see https://docs.perl6.org/language/regexes#Subrules Fascinating and way over my head. Give me a year or two to catch up.

Re: need help with "next"

2017-05-24 Thread ToddAndMargo
gt; ; > > SAMPLE > > for @Data { > next unless m/ 'NAME' .*? '>' $=( .*? ) '<' /; > say $; # say implicitly stringifies $ > } > > > Hi Richard. The idea is that the names can not be extracted unless they are embedded ins

Re: need help with "next"

2017-05-24 Thread Richard Hainsworth
On 05/23/2017 10:31 PM, Richard Hainsworth wrote: > The code below seems unnecessarily complex. > > How about: > > my @Data = q:to/SAMPLE/; > > Mission D', > Sol Wheat, > Ted Moon, > ; > > SAMPLE &g

Re: need help with "next"

2017-05-24 Thread ToddAndMargo
On 05/24/2017 12:02 AM, Norman Gaywood wrote: On 24 May 2017 at 16:40, Norman Gaywood > wrote: However, your code does not look like it will do what you want if you have multiple TASKs Yes it does. Sorry ignore me :-) Oh it had issues. They showe

Re: need help with "next"

2017-05-24 Thread ToddAndMargo
On 05/23/2017 11:40 PM, Norman Gaywood wrote: I'm a rank beginner p6 programmer so You are further along than me!

Re: need help with "next"

2017-05-24 Thread ToddAndMargo
On 05/23/2017 11:40 PM, Norman Gaywood wrote: However, your code does not look like it will do what you want if you have multiple TASKs I improved it. See my other follow post #3

Re: need help with "next"

2017-05-24 Thread ToddAndMargo
Oh, you know what, I thought it might be a good idea to throw some negative case data into the mix. This is what I came up with: #!/usr/bin/env perl6 use strict; my @Data = 'Mission A', ' Peter Meter', ' John Deer', ' Sam Horse', '',

Re: need help with "next"

2017-05-24 Thread Norman Gaywood
On 24 May 2017 at 16:40, Norman Gaywood wrote: > > However, your code does not look like it will do what you want if you have >> multiple TASKs >> > > Yes it does. Sorry ignore me :-) -- Norman Gaywood, Computer Systems Officer School of Science and Technology University of New England Armidal

Re: need help with "next"

2017-05-23 Thread Norman Gaywood
On 24 May 2017 at 15:20, ToddAndMargo wrote: > > > This is what I came up with. I found that `next` did not serve me > well, so i just used a tag. > > Thank you all for the help. I had a bit of a time wrapping > my head around `next` there for a while. > > -T > >

Re: need help with "next"

2017-05-23 Thread ToddAndMargo
On Wednesday, May 24, 2017 01:20 PM, ToddAndMargo wrote: On 05/23/2017 09:30 PM, ToddAndMargo wrote: Hi All, I have a test code in progress and I haven't figured out how to get 'next' to work the way I want. next if $Line.contains( "TASK type" ); works, bu

Re: need help with "next"

2017-05-23 Thread Richard Hainsworth
The code below seems unnecessarily complex. How about: my @Data = q:to/SAMPLE/; Mission D', Sol Wheat, Ted Moon, ; SAMPLE for @Data { next unless m/ 'NAME' .*? '>' $=( .*? ) '<' /; say $; # say implicitly stringifies $

Re: need help with "next"

2017-05-23 Thread ToddAndMargo
On 05/23/2017 09:30 PM, ToddAndMargo wrote: Hi All, I have a test code in progress and I haven't figured out how to get 'next' to work the way I want. next if $Line.contains( "TASK type" ); works, but if $Line.contains( "TASK type" ) {

Re: need help with "next"

2017-05-23 Thread ToddAndMargo
Any data fulfilling the 'if' condition, and thus entering this block will be 'next'ed. Nothing will pass the 'next'. But no data not fulfilling the condition will 'see' the code below, which is not what you intend. Perhaps you omitted an 'else

Re: need help with "next"

2017-05-23 Thread Richard Hainsworth
On Wednesday, May 24, 2017 12:46 PM, ToddAndMargo wrote: On Tue, May 23, 2017 at 11:30 PM, ToddAndMargo wrote: Hi All, I have a test code in progress and I haven't figured out how to get 'next' to work the way I want. next if $Line.contains( "TASK type"

Re: need help with "next"

2017-05-23 Thread ToddAndMargo
On Tue, May 23, 2017 at 11:30 PM, ToddAndMargo wrote: Hi All, I have a test code in progress and I haven't figured out how to get 'next' to work the way I want. next if $Line.contains( "TASK type" ); works, but if $Line.contains( "TASK type" )

Re: need help with "next"

2017-05-23 Thread Brad Gilbert
You do realize that `next` immediately stops the current iteration and goes onto the *next* one right? That is, there is no point putting any code after it because it will never be run. On Tue, May 23, 2017 at 11:30 PM, ToddAndMargo wrote: > Hi All, > > I have a test code in progr

need help with "next"

2017-05-23 Thread ToddAndMargo
Hi All, I have a test code in progress and I haven't figured out how to get 'next' to work the way I want. next if $Line.contains( "TASK type" ); works, but if $Line.contains( "TASK type" ) { next; does not. What am I missing? Many than

Re: The next 100 Years

2014-11-17 Thread Moritz Lenz
Hi Sayth, On 17.11.2014 12:51, Sayth Renshaw wrote: As a person new and looking at Perl 6 as I have done over the time I am interested to know from Perl 6 Language advocates what exactly the strength and benefit of Perl 6 is and will likely be? * Perl 6's built-in grammars make parsing really

The next 100 Years

2014-11-17 Thread Sayth Renshaw
As a person new and looking at Perl 6 as I have done over the time I am interested to know from Perl 6 Language advocates what exactly the strength and benefit of Perl 6 is and will likely be? Is there a particular domain it is going to be especially useful for ? Is it going to be able to design

Re: Estimate for next Rakudo Star release?

2011-04-28 Thread Moritz Lenz
Hi, On 04/28/2011 12:48 AM, Brian Wisti wrote: > Is it close? Any pressing issues? Did I miss an announcement? Very close: http://rakudoperl.org/2011/04/28/rakudo-star-2011-04-released/ (rakudo.org will soon also point to the new location). Cheers, Moritz

Re: Estimate for next Rakudo Star release?

2011-04-27 Thread Brian Wisti
Hi, On Wed, Apr 27, 2011 at 7:36 PM, Bruce Gray wrote: > > [ snippage of useful information ] > Thanks for the update! I wanted to make sure I hadn't missed anything. Kind Regards, Brian Wisti http://coolnamehere.com

Re: Estimate for next Rakudo Star release?

2011-04-27 Thread Bruce Gray
On Apr 27, 2011, at 5:48 PM, Brian Wisti wrote: --snip-- Is it close? Yes; I was looking for it today. There may be a short additional delay :) Any pressing issues? Not really; just "last minute" adjustments and additions that are expected when a release has not been cut for 3 months. Fo

Estimate for next Rakudo Star release?

2011-04-27 Thread Brian Wisti
Hey all, By my admittedly limited math, it's been almost three months since Rakudo Star 2011.01 was released. The announcement at mentioned the shift was to a three month schedule. So ... Is it close? Any pressing issues? Did I miss an announcemen