def cat_read(filelist, open_function, mode):
    """Line-based iteration across multiple input files."""
    for file in filelist:
        with open_function(file, mode) as ifo:
            for line in ifo:
                yield line
