Help for this page

Select Code to Download


  1. or download this
    my $fileSize = -s $fileName;
    
  2. or download this
    my $fileSize = (stat $fileName)[7];
    
  3. or download this
    my $limit = 160;
    my $bytesToRead
       = $fileSize > $limit
       ? $limit
       : $fileSize;
    
  4. or download this
    my $bytesRead = read($inpFH, my $inpBuffer, $bytesToRead);
    
    ...
       unless $bytesRead == $bytesToRead;
    
    print $inpBuffer;