Mostly FASTA file contain NNN characters, which can be replace by random A T G C character with this perl script. It also print the FASTA sequence name, N's counts, nucleotide count and percentage details at command prompt/standard output.
You can use a s/// regex like this:
my $str = "This is my string";my $find = "string";my $replace = "strings";$find = quotemeta $find; # escape regex metachars if present
##The quotemeta lets you find strings that contain regex meta characters...