L
Leif K-Brooks
I have the following Perl code. When I run it, Perl complains that $1 is
undefined. If I change (foo)|(bar) to (bar)|(foo), it works fine. I know
I could just use /(foo|bar)/, but this is just a simplified example.
use strict;
use warnings;
my $text = 'bar';
if ($text =~ /(?
foo)|(bar))/) {
print $1;
}
undefined. If I change (foo)|(bar) to (bar)|(foo), it works fine. I know
I could just use /(foo|bar)/, but this is just a simplified example.
use strict;
use warnings;
my $text = 'bar';
if ($text =~ /(?
print $1;
}