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]; ...

In reply to Re^3: issue with checking file size by almut
in thread issue with checking file size by kyle blaque

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.