$ perl -del DB<1> $x = join('',('','x'x((1<<30)-10),'')x2); while( $x =~ m{}g ) { print pos($x), $/ } 1073741821 2147483642 DB<1> $x = join('',('','x'x((1<<30)-10),'')x3); while( $x =~ m{}g ) { print pos($x), $/ } DB<2>