On a related note, perhaps $mkfn() should replace $chr(1) with _, since it's not allowed in filenames.