FAQ
Hello all.

I'm trying to compare the size of two files in a script. I know I can open them, feed each into an array, and compare the number of lines, but that seems silly and inefficient. I tried using File::stat in the following manner:

$file1 = stat($firstFile);
$file2 = stat($secondFile);

if ($file1->size > $file2->size)
{
blahblahblah;
}

Everytime the script gets to these lines, the stat function fails, and the program exits. Am I doing somthing wrong? I'm using perl 5.8.0 on Redhat 8.0.

Thanks for the help,
Brian

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupbeginners @
categoriesperl
postedJan 3, '03 at 7:10p
activeJan 3, '03 at 7:23p
posts2
users2
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase