Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;
- use warnings;
- use autodie; # Handle i/o errors
- local $/ = '>'; # Read a '>' delimited record at a time
- open my $inFH, '<', 'test.txt'; # Use lexical file handles
- open my $outFH, '>', 'test_output.txt';
- while (<$inFH>) {
- chomp;
- my ($string) = /\n(.+)/s or next;
- $string =~ s/\n//g; # In case the sequences are multi-line
- my @patches;
- push @patches, substr $string, $_, 11 for 0 .. length($string) - 11;
- print $outFH "@patches\n";
- }
- close $outFH;
- close $inFH;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement