in reply to Efficiently processing a file
count_bases(20, $ARGV[1]); count_bases(30, $ARGV[1]); [download]
Why you're using that sub in the first place ? what you're trying to do it not clear (for me).
You can test multiple conditions against the current line instantly then loop & get the next line.
but instead I see that you're SEEKING to the beginning of the file each time you want to check for something which is not efficient