The program is supposed to recreate permissions of files. It would be run over both symlinks and non-symlinks, and over non-symlinks any function will do, however for symlinks I would need lchown. So I want my script to have full functionality on systems with lchown and at least partial functionality on systems without it.
However you are right .. I do not really want to even attempt the chown if it is a symlink and I do not have lchown. I guess this would be more appropriate:
sub best_chown($$$) {
chown(@_) unless -l $_[0];
}
Does this make sense?