develooper Front page | perl.perl6.users | Postings from June 2018

Re: need second pair of eyes

Thread Previous
From:
ToddAndMargo
Date:
June 12, 2018 23:34
Subject:
Re: need second pair of eyes
Message ID:
77c46f1f-adb8-9212-db6e-1f5f564532e7@zoho.com
On 06/12/2018 03:41 PM, ToddAndMargo wrote:
> Hi Alk,
> 
> What am I dong wrong here?
> 
> 
> $ p6 'my $Line = "wine-patched/archive/staging-/xxxxx.tar.gz"; if $Line 
> ~~ | "wine-patched/archive/staging-/"   &&   ".tar.gz " |  {say "yes"} 
> else {say "no};'
> 
> ===SORRY!===
> Expression needs parens to avoid gobbling block
> at -e:1
> ------> ging-/"   &&   ".tar.gz " |  {say "yes"}⏏ else {say "no};
> Missing block (apparently claimed by expression)
> at -e:1
> ------> ging-/"   &&   ".tar.gz " |  {say "yes"}⏏ else {say "no};
> 
> 
> :'(
> 
> -T


This fixed it:

$ p6 'my $Line = "wine-patched/archive/staging-/xxxxx.tar.gz";if $Line 
~~ / "wine-patched\/archive\/staging\-\/" / & / ".tar.gz" /  {say "yes"} 
else {say "no"};'


How do I use "|" instead of "/"?  I am trying to rid myself of the
/\/\//\//\\/\/  tree

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About