No, it still doesn't do what you advertise:
#!/usr/bin/perl
use strict;
use warnings;
our $data;
print "\n\n original\n";
foreach (split("\n",$data))
{
if(/start/ .. (!(/start/../end/) && /end/))
{ print "$_\n"}
}
print "\n\n analysis:\n";
print " - note that range operator is set to true when \$flag1 is t
+rue\n";
print " becomes false only after \$flag3 has been set to tru
+e\n";
print "\n";
foreach (split("\n",$data))
{
my $flag1=0;my $flag2 = 0;my $flag3=0;
$flag1 = 1 if (/start/);
$flag2 = 1 if (/start/../end/);
$flag3 = 1 if (!$flag2 && /end/);
print "$flag1, $flag2, $flag3, $_",' 'x(15-length($_));
if(/start/ .. (!(/start/../end/) && /end/))
{ print "success\n"}
else {print "\n";}
}
BEGIN {
our $data = << 'TEST';
a
a
a
start
b
start
c
d
e
end
f
start
g
h
i
end
j
end
k
k
l
TEST
}
result
original
start
b
start
c
d
e
end
f
start
g
h
i
end
j
end
analysis:
- note that range operator is set to true when $flag1 is true
becomes false only after $flag3 has been set to true
0, 0, 0, a
0, 0, 0, a
0, 0, 0, a
1, 1, 0, start success
0, 1, 0, b success
1, 1, 0, start success
0, 1, 0, c success
0, 1, 0, d success
0, 1, 0, e success
0, 1, 0, end success
0, 0, 0, f success
1, 1, 0, start success
0, 1, 0, g success
0, 1, 0, h success
0, 1, 0, i success
0, 1, 0, end success
0, 0, 0, j success
0, 0, 1, end success
0, 0, 0, k
0, 0, 0, k
0, 0, 0, l