in reply to File tests failing

I'm sure it's just a typo, but my $size = -e $filename; should be my $size = -s $filename;, although that really has nothing to do with your problem. With your current code, if the file existed, -e would at least return a 1, so you wouldn't get the uninitialized error.

Are you sure the file exists? Are you sure the file is in the CWD of the script? Have you tried running a test script on the command line to see if that at least works?

You could also try stat, but i thought the file tests used it internally anyway: my $size = (stat $filename)[7]