Thank you! I have taken your example and adapted it to my own purposes.
I was wondering how I could go about using a space as the delimiter for each search string i.e. in my original code I would specify each substring via:
my @pats=qw( GATCR GGCC );
However I now need the user to input each substring with a space in between each and for the script to treat each one as a separate search to carry out.
Thanks again!