in reply to New Spreadsheet

This won't fix your problem, but don't do "$file", just use $file. There is no reason to put a variable in quotes (unless you're building a string like in the die argument).