[Solved] perl parsing inserting new line and ^M

My guess is, that you are working with a linux file on some windows. Perl automatically converts \n into \r\n on dos-compatible machines after reading and before writing. To get rid of this behaviour, you can use binmode <FILE> on your filehandles, but it sets your filehandle into “raw binary mode”. If you want to … Read more

[Solved] Generating sets of array in perl

Loop over @nobreak? my $s=”MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN”; print “Results of 1-Missed Cleavage:\n\n”; my @nobreak = (37,45,57,59); for my $nobreak (@nobreak) { substr($s, $nobreak-1, 1) = “\0”; my @a = split(/E(?!P)/, $s); substr($s, $nobreak-1, 1) = ‘E’; $_ =~ s/\0/E/g foreach (@a); $result = join (“E,”, @a); @final = split(/,/, $result); print “@final\n”; } solved Generating sets of … Read more