# Remove comment line(s) and white space $para =~ s/^\s*#.*//mg; $para =~ s/\s//g; # add my $seq_length = length($para); # add print "[$para]\n"; # optional . . printf $out_file "Number of proteins = %d\n",$num ; printf $out_file "String length = %d\n\n",$seq_length; # add