-# Apparently the "old way" to get S_ISLNK and friends is to do this:
-#
-use POSIX ':fcntl_h';
-
-# But apparently the "new way" is to do this:
-#
-# use Fcntl ':mode';
-#
-# but of course that will generate an error on "old" (pre-5.6?) Perl versions.
-# So we do it like this instead:
-#
-BEGIN {
- if (! defined(&S_ISLNK)) { # perhaps defined by "POSIX"?
- require Fcntl;
- import Fcntl ':mode'; # if not, look for it in "Fcntl".
- }
-}
+use POSIX ':fcntl_h'; # S_ISLNK was here in Perl 5.6
+import Fcntl ':mode' unless defined &S_ISLNK; # but it is here in Perl 5.8