Hello, just starting down the road of perl, and I need to get this figured out. I'm trying to make an addition to some code so that it checks the file size prior to stating the upload message. here is the script for upload
#!/usr/bin/perl use strict; use CGI qw(:standard); my(@parameters) = param; my $work = ""; my $value = ""; my $company = param('cmdSubmit'); $company = substr($company, 8); my $file = "Response ".param('txtAppNumber')." R".param('txtRevID').". +txt"; foreach my $fieldName (@parameters) { $value = param($fieldName); $value=~s/%/%25/g; $value=~s/\n/%0D%0A/g; $value=~s/\r//g; $value=~s/=/%3D/g; $value=~s/&/%26/g; $work = $work.$fieldName."=".$value."&"; #$work = $work.$fieldName."=".param($fieldName)."&"; } $work = substr($work, 0, length($work)-1); open(F, ">C:\\wamp\\www\\Web Forms\\Data\\Critique\\$company\\$file") +|| die "Cannot create $file\: $!"; #while($work=~s/\n/%0D%0A/){} #while($work=~s/\r/%0D%0A/){} print F $work; close(F); my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtim +e, $ctime, $blksize, $blocks) = stat($file); print header; print "<p>Congratulations! Upload operation successful. You can now +close your browser.</p>"; #print $size<p>size</p>; # print "<p>$file</p>";
you can see here at the bottom that I'm not able to pull out my filehandle object array variables... If I can just get the filehandle variables to show up then I can use a simple IF statement... any help is appreciated as I'm still really new to perl.. Thanks, k

In reply to 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.