in reply to Comparing Elements of Two Arrays
This returns true if the paths point to the same file, false (defined) if they don't, and undef if either stat fails (probably because the file doesn't exist).sub compare_paths { my($dev1, $inode1) = stat $_[0]; my($dev2, $inode2) = stat $_[1]; return unless defined $dev1 and defined $dev2; return $dev1 == $dev2 && $inode1 == $inode2; }
|
|---|