At the risk of sounding pedantic, I have to say that's not how you open a file in Perl (at least 3 things wrong in that first line) and that link you provided is outdated (see the perfunc page for open). The only reason you should ever use that form is to show people how it was done once upon a time, but it is very problematic and should never be used. There is really no debate on the matter (the Perl authors say they are trying to "rid the world" of this in the latest camel book) but it is still very prevalent because there are so many old books around and many webpages pop up with these guides (try to stick to the perldoc pages).
The modern perl books page has some good advice and some specific recommendations for Perl guides. Also, the Modern Perl book is free and the author (chromatic) maintains an active Perl blog that is very informative. I hope it doesn't seem like I'm nitpicking, it's just that I see this everyday on biostars and it bothers me, but for someone to say "do it this way" is not something I can ignore. Hopefully, this will save you some time. I talked to a couple of programmers at the Perl conference this summer and they told me they had just spent a month tracking down a bug in a large code base for their company, and it was related to this.
First try it yourself. If it doesnt work, try these posts. They are pretty relevant to what you are trying to do Parse fastq file - pad reads with N's
Fastq Quality Read and Score Length Check