qw ($chromosomefilename); doesn't do what you think it does. There's no interpolation inside qw. Furthermore, do you really want to search in the file
name? Perhaps you want to search in the file
content, but since you have removed all whitespace, I wonder what your intend of the
qw is.
If you just want to know whether ACGT is present, just use the grep or ack utility.