now it's saying no file in that directory, which leads me to believe
that I'm not locating the correct file...
Not sure I understand. What exactly is saying "no file in that directory",
and what do you mean by locating the file?
AFAICT, the code writes the content of $work to a file which is created
with the path
"C:\\wamp\\www\\Web Forms\\Data\\Critique\\$company\\$file"
Presuming the writing of the file succeeded, you should be able to
successfully stat() the file afterwards, if you use the exact
same path that you used to create the file...
So, have you checked whether the file gets created/written at all?
Is the $company component of the path a valid (existing) directory?
Do you have appropriate permissions to write the file?
Is there an error message when trying to open the file?
I'd start debugging with printing out the path to see what the
variable parts coming from the form ($company\$file) were set to...
Also, you can make your life a little easier, if you assign the path once
to some variable, which you then use everywhere, i.e. in the open(),
the corresponding error message, the stat(), in debug prints, etc.
For example:
...
my $path = "C:\\wamp\\www\\Web Forms\\Data\\Critique\\$company\\$file"
+;
# print STDERR "$path\n"; # debug
open(F, ">", $path) or die "Cannot create '$path': $!";
print F $work;
close(F);
my $size = (stat $path)[7];
...
|