in reply to Re^2: =~ matches non-existent symbols
in thread =~ matches non-existent symbols

what if I need to do further manipulations with the data from the file later in the same program?

Presumably, the manipulation will depend on whether the file content is "good" or "bad" - in either case, just save a copy of $_ to some other variable after white-space removal but before removing "acgt"; then pass that copy to whatever function you write to do the manipulation (either good or bad).