in reply to Quality trimming of fastq file

For a less error-prone approach, you should be using Bio::SeqIO::fastq for fastaq formatted I/O.

                We're living in a golden age. All you need is gold. -- D.W. Robertson.