or download this
$perl simple.pl
String: "This is a simple thing, just a simple simple thing."
...
$1 is simple, pos($test3) is 16, loop counter is 0
$1 is simple, pos($test3) is 37, loop counter is 1
$1 is simple, pos($test3) is 44, loop counter is 2