in reply to Using File::stat
Well, your second path doesn't end in a / which your code seems to require.