Below script break the sequence at every ‘E’ and subsequently an ‘E’ is added on to each fragment. But I’m not getting ‘E’ attached to my last element, Why?
use strict;
use warnings;
my $s = 'ABCDEABCDEABCDEABCDEABCDE';
my @a = split /E(?!P)/, $s;
my $result = join "E,", @a;
my @final = split /,/, $result;
print "@final\n";
See the documentation of
split: