0 Replies - 1422 Views - Last Post: 12 October 2007 - 09:56 AM

#1 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6819
  • View blog
  • Posts: 31,418
  • Joined: 10-May 07

File Size Using File Method

Posted 12 October 2007 - 09:56 AM

Description: This snippet uses File::stat to retrieve the size of the file.
#!/usr/bin/perl
use strict;
use warnings;
use File::stat;

my $path = ".";
my $file = "test.txt";

my $filesize = stat($path."/".$file)->size;

print "Size: $filesizen";

Is This A Good Question/Topic? 0
  • +

Page 1 of 1