perlpipe has asked for the wisdom of the Perl Monks concerning the following question:
my $r="abc|xyz"; my $rx=qr($r); my $c="XYZ"; my $x1=($c=~/$rx/i); my $x2=(lc($c)=~/$rx/i); say "\$x1=$x1"; say "\$x2=$x2";
Results in:
$x1=
$x2=1
Shouldn't the /i give us a case insensitive match?
Perl version: This is perl 5, version 28, subversion 0 (v5.28.0) built for MSWin32-x64-multi-thread
Running on Windows 10
Am I missing something obvious>
TIA
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why does /i not seem to work
by choroba (Cardinal) on Nov 21, 2019 at 15:47 UTC | |
|
Re: Why does /i not seem to work
by Eily (Monsignor) on Nov 21, 2019 at 15:49 UTC | |
by AnomalousMonk (Archbishop) on Nov 21, 2019 at 16:14 UTC | |
|
Re: Why does /i not seem to work
by LanX (Saint) on Nov 21, 2019 at 15:45 UTC | |
|
Re: Why does /i not seem to work
by perlpipe (Acolyte) on Nov 21, 2019 at 22:53 UTC |