From 44e4059baf939468ae61cb63c0c2871c40147dc3 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Tue, 4 May 2021 15:04:25 +1000 Subject: [PATCH] avoid a prototype warning assigning \&getcwd to *cwd This would produce a warning if we fallback to using getcwd() where getcwd() has a prototype. --- dist/PathTools/Cwd.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/PathTools/Cwd.pm b/dist/PathTools/Cwd.pm index 2e9b311aa561..a5f86a411b67 100644 --- a/dist/PathTools/Cwd.pm +++ b/dist/PathTools/Cwd.pm @@ -212,7 +212,8 @@ unless ($METHOD_MAP{$^O}{cwd} or defined &cwd) { *cwd = \&_backtick_pwd; } else { - *cwd = \&getcwd; + # getcwd() might have an empty prototype + *cwd = sub { getcwd(); }; } }