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

regex interpolation of array

Thread Next
From:
Richard Hainsworth
Date:
June 13, 2020 10:35
Subject:
regex interpolation of array
Message ID:
dc34e05d-14e6-6754-e37d-605c2b611204@gmail.com
I was playing with a regex and array interpolation.

 From the documentation I thought the following comparisons would be the 
same, but they are not.

What am I missing?

my @W = <perl weekly challenge with some extra things>;
my $S = 'perlchallengeextrathingswithweeklysome' ; #randomly concatenate the words without spaces say 'yes' if $S ~~ / $<sol>=( {@W[3] }) /;
say $<sol>;
my $sol = @W[3]; # with
say 'yes' if $S ~~ / $<sol>=( $sol ) /;
say $<sol>;

<response>
yes
「」
yes
「with」




Thread Next


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