note
moritz
<blockquote>As per your code, your m// expression will match first digits ( 55 ) at all time as per my understanding</blockquote>
<p>No, because I used <c>m/../g</c> in scalar context, which remembers the previous match position in [doc://pos], and then always returns the next match during subsequent calls.
<p>Maybe you are more familiar with it in this idiom:
<code>
use 5.010;
$_ = 'a123b45c6';
while (m/(\d+)/g) {
say $1;
}
</code>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-616540">
[http://perl6.org/|Perl 6 - the future is here, just unevenly distributed]
</div></div>
1009091
1009495