I wanted to run a code that continuosuly checks if a file exits if it exists then checks the files' MD5 against the previous MD5 . If there is some changes then it executes some code. But the perl MD% seems to be changing every time I call the hexdigest for the same file. Does MD5 change everytime ?
I intially had
$md5 = Digest::MD5->new;
before while(1)
If this is not how it is to be done is there anything else to achieve my intentions ? Thanks
while(1)
{
if(!(-e $config_file)){
next;
}else{
$md5 = Digest::MD5->new;
$md5->addpath($config_file);
print "<->";
print $md5->hexdigest;
$value=($digest eq $md5->hexdigest ? 1 : 0);
if($value==1)
{
next;
}else
{
$digest=$md5->hexdigest;
}
}
}