$\ = "\n"; $, = ","; print 'a string' =~ m/(.(?{pos()+=4}))/g; __END__ prints "a, ,s,t,r,i,n,g". It should print "a,i"