in reply to isolating strings
Problem #1:
@file=<INFILE>; [download]
reads the entire file, so the subsequent
while(<INFILE>) [download]
will exit immediately.