note
backstab
<p>My solution with the while loop works with many emails
on the same line. In fact doing so we consider the text
as a whole totally ignoring newlines.</p>
<p>The idea of /g flag within a while is each match will
start where the previous one has stopped and the loop
stops when there is no more successful match.</p>
<p>The special variable <code>@-</code> is an array with
the match start and end positions respectivly as
<code>$-[0]</code> and <code>$-[1]</code> it might
help to see what the loop does,</p>
<code>
while ($txt =~ /constant=(\w+@\w+\.\w+)/g) {
print "==> match starts at $-[0]!!!\n";
print "$1\n";
}
</code>
732848
732862