(defun perllib-check-path (lst lib-path) (let ((dir (car lst)) (lst (cdr lst))) (setf lib-path (concat lib-path "/" dir)) (if lst (if (string= dir "lib") lib-path (perllib-check-path lst lib-path))))) (defun set-perl5lib () "insert path to PERL5LIB if its path includes 'lib' directory." (interactive) (setf path-list (cdr (split-string buffer-file-name "/")) lib-path (perllib-check-path path-list "