http://www.perlmonks.org?node_id=1014499


in reply to Re^4: Uniquely identifying each & every html template
in thread Uniquely identifying each & every html template

Am i not still the same person i used to be?

Perhaps.

Upon being presented with an award by the council for saving money by using the same broom for 20 years, a character in a famous British sitcom said:

And that's what I've done. Maintained it for 20 years. This old broom's had 17 new heads and 14 new handles in its time.

To which the inevitable response is, how the hell can it be the same bloody broom then?

This is an ancient question, best known as Theseus' paradox.

Most of the cells in your body aren't much more than a few years old. (Some are in it for the long haul - after adolescence we don't grow many more brain cells for example - we just start putting them to better use!) So are you the same person that you were 10 years ago?

If you think you are, what makes you the same person? What has been the constant factor that you can point to over the last ten years that allows you to consider yourself to be a continuation of the same person?

Now, to more practical matters, what constant factor can you point to over file changes that allows you to consider two files to be the same file? Write an algorithm to detect that factor. Job done.

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
  • Comment on Re^5: Uniquely identifying each & every html template

Replies are listed 'Best First'.
Re^6: Uniquely identifying each & every html template
by Nik (Initiate) on Jan 21, 2013 at 17:42 UTC
    yes indeed! after changing broom's part the broom isnt wat it used to be just like myself :)

    I dont have a constant factor for the files but i guess if the file's contents change then its not to be considered the same file anymore....even if it has the slightest change and the subject remains the same....

    So you advice me to use the hash method, being a number that is produced by by the file's contents at that time?