need p5 to p6 help

2017-06-11 Thread ToddAndMargo
Hi All, I am not having a lot of lick converting this from P5 to P6 P5: $str !~ /[^A-Za-z0-9_]/ P6: $ perl6 -e 'my $x="\t"; if !~ /[^A-Za-z0-9]/ {say "outside"} else {say "inside"};' What am I doing wrong? -T -- ~ When we ask

Re: need p5 to p6 help

2017-06-11 Thread ToddAndMargo
On 06/11/2017 03:52 PM, ToddAndMargo wrote: Hi All, I am not having a lot of lick converting this from P5 to P6 P5: $str !~ /[^A-Za-z0-9_]/ P6: $ perl6 -e 'my $x="\t"; if !~ /[^A-Za-z0-9]/ {say "outside"} else {say "inside"};' What am I doing wrong? -T Okay, found a couple of booboos,

Re: need p5 to p6 help

2017-06-11 Thread Brandon Allbery
On Sun, Jun 11, 2017 at 6:52 PM, ToddAndMargo wrote: > P6: > $ perl6 -e 'my $x="\t"; if !~ /[^A-Za-z0-9]/ {say "outside"} else {say > "inside"};' > You missed a "$x" in there. Negation works differently in perl 6 regex. /<-[A..Z a..z 0..9]>/ pyanfar «work*master» Z$ 6 'my $x = "["; if $x !~~ /

Re: need p5 to p6 help

2017-06-11 Thread ToddAndMargo
On 06/11/2017 03:57 PM, Brandon Allbery wrote: 6 'my $x = "c"; if $x !~~ /<-[A..Z a..z 0..9]>/ {say "out"} else {say "in"}' Hi Brandon, Thank you! All typos today. And I now understand the <[]> syntax. -T I wrote this up for my keepers file: Perl6: checking for the presence of a charact

contains question

2017-06-11 Thread ToddAndMargo
Hi All, perl6 -e 'my $x = "\t"; if $x !~~ /<[A..Z a..z 0..9]>/ {say "out"} else {say "in"}' Would this be easier to do with $x.contains? Or would it be too worky? Many thanks, -T