in reply to Efficiently processing a file

I ment to write $ARGVΏ] for for 1st code example. I was also wondering if I should be using foreach or while in this situation and if it would be faster to call the subroutine by reference
count_bases(20, $ARGV[1]); count_bases(30, $ARGV[1]);

Replies are listed 'Best First'.
Re^2: Efficiently processing a file
by ahmad (Hermit) on Jan 25, 2010 at 22:33 UTC

    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