my $str = 'the quick brown fox'; while( $str =~ m/(.)/g) { print "Matched '$1' \@ pos:", pos(); }