On Jun 12, 2013, at 2:33 AM, lee wrote:

> Jim Gibson <jimsgib...@gmail.com> writes:
> 
>> 
>> The first thing to do would be to check the file size. If the file
>> size has changed, then the file has been modified. So you will want to
>> save the file size.
> 
> The file might be modified without changing its size ...

That is true. The advantage of checking the file size first is that it is a 
very quick test that does not require reading the entire file. You can get the 
file size in Perl one of two ways:

1.   my $size = (stat($filename))[7];

or 

2.  my $size = -s $filename;


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to