http://www.perlmonks.org?node_id=1037468


in reply to Removing nucleotide frm sequence

You probably want something more refined than this, but something similar to:
while (<>) { # $ denotes end of string s/AAAAA$//; s/>CC\@B$//; print; }
Not quite sure if your sequence is on one line or multiple lines, so the above will need some tweaking. If you need some more help, please amend your question, putting a complete sequence in code blocks
If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)