I am not running the script via CGI and Blat works well for my needs (though thanks for the suggestion). $filename does not contain the full path, but I've testing running the code with $filename set to a file that exists prior to running the script and it works fine (Blat looks in the directory from which the script was run).