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
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!
>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
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
On 01/16/2018 12:57 AM, Elizabeth Mattijsen wrote:
On 16 Jan 2018, at 09:46, ToddAndMargo <toddandma...@zoho.com> 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/
On 01/16/2018 12:57 AM, Elizabeth Mattijsen wrote:
On 16 Jan 2018, at 09:46, ToddAndMargo <toddandma...@zoho.com> 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??).
> On 16 Jan 2018, at 09:46, ToddAndMargo <toddandma...@zoho.com> 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??).*/;
>
>
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
On Mon, Jun 19, 2017 at 11:35 AM, Brad Gilbert <b2gi...@gmail.com> 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 c
$i) and check the condition and act
>> accordingly doing the next iteration or quitting the loop.
>
>
> Just checking but there are no "continue" blocks for loop control stmts
> anymore, P6? Google suggested maybe foreach loops but that was back in 2011.
>
Instead of a `contin
On Fri, Jun 16, 2017 at 11:11 PM, Gabor Szabo <szab...@gmail.com> 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.
&
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
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
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 =
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
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
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
On Sat, Jun 17, 2017 at 4:19 AM, ToddAndMargo <toddandma...@zoho.com> wrote:
> On 06/16/2017 06:08 PM, Brandon Allbery wrote:
>>
>> On Fri, Jun 16, 2017 at 9:02 PM, ToddAndMargo <toddandma...@zoho.com
>> <mailto:toddandma...@zoho.com>> wrote:
>>
&g
On 06/16/2017 06:08 PM, Brandon Allbery wrote:
On Fri, Jun 16, 2017 at 9:02 PM, ToddAndMargo <toddandma...@zoho.com
<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 o
On Fri, Jun 16, 2017 at 9:02 PM, ToddAndMargo <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 cough up the next value?
>
The former. Or you can think o
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.
~~~
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.
;
>
> 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 inside a task field. I found the
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
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
On 05/23/2017 11:40 PM, Norman Gaywood wrote:
I'm a rank beginner p6 programmer so
You are further along than me!
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
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',
'',
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
On 24 May 2017 at 15:20, ToddAndMargo <toddandma...@zoho.com> 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
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, but
if $Lin
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 $
}
On Wednesday, May 24, 2017 01
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" ) {
next;
does not
On Wednesday, May 24, 2017 12:46 PM, ToddAndMargo wrote:
On Tue, May 23, 2017 at 11:30 PM, ToddAndMargo
<toddandma...@zoho.com> 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( &quo
On Tue, May 23, 2017 at 11:30 PM, ToddAndMargo <toddandma...@zoho.com> 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.cont
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 <toddandma...@zoho.com> wrote:
> Hi All,
>
> I h
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 thanks,
-T
yes I kn
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
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.
For
Hi,
On Wed, Apr 27, 2011 at 7:36 PM, Bruce Gray bruce.g...@acm.org 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
40 matches
Mail list logo