use List::Util qw/ shuffle /; my @strings = map { join '', shuffle( ('X') x 10, ('-') x 590 ) } 1 .. 1000;