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

In reply to Re: Beautiful .. operator by Sandy
in thread Beautiful .. operator by grizzley

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.