summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Marquess <pmarquess@bfsec.bt.co.uk>1997-01-08 16:55:02 +0000
committerChip Salzenberg <chip@atlantic.net>1997-01-16 07:24:00 +1200
commitac1ad7f00e63b0423f397847dd05653ab9cea16c (patch)
tree82498d4107a06f574c21dadef227a2ce8d8f609f /lib
parent3f73d1e9321c4a88755d416e8a3bef027db02853 (diff)
downloadperl-ac1ad7f00e63b0423f397847dd05653ab9cea16c.tar.gz
low priority patches
this set of patches isn't super critical, but it does tidy a few things up in anticipation of lexical warnings. p5p-msgid: <9701081655.AA27349@claudius.bfsec.bt.co.uk>
Diffstat (limited to 'lib')
-rw-r--r--lib/Cwd.pm55
1 files changed, 27 insertions, 28 deletions
diff --git a/lib/Cwd.pm b/lib/Cwd.pm
index d7a4875574..e93cf1a0a9 100644
--- a/lib/Cwd.pm
+++ b/lib/Cwd.pm
@@ -244,36 +244,35 @@ sub _msdos_cwd {
return $ENV{'PWD'};
}
-my($oldw) = $^W;
-$^W = 0; # assignments trigger 'subroutine redefined' warning
-if ($^O eq 'VMS') {
-
- *cwd = \&_vms_cwd;
- *getcwd = \&_vms_cwd;
- *fastcwd = \&_vms_cwd;
- *fastgetcwd = \&_vms_cwd;
-}
-elsif ($^O eq 'NT' or $^O eq 'MSWin32') {
+{
+ local $^W = 0; # assignments trigger 'subroutine redefined' warning
- # We assume that &_NT_cwd is defined as an XSUB or in the core.
- *getcwd = \&_NT_cwd;
- *fastcwd = \&_NT_cwd;
- *fastgetcwd = \&_NT_cwd;
-}
-elsif ($^O eq 'os2') {
- # sys_cwd may keep the builtin command
- *cwd = defined &sys_cwd ? \&sys_cwd : \&_os2_cwd;
- *getcwd = defined &sys_cwd ? \&sys_cwd : \&_os2_cwd;
- *fastgetcwd = defined &sys_cwd ? \&sys_cwd : \&_os2_cwd;
- *fastcwd = defined &sys_cwd ? \&sys_cwd : \&_os2_cwd;
-}
-elsif ($^O eq 'msdos') {
- *cwd = \&_msdos_cwd;
- *getcwd = \&_msdos_cwd;
- *fastgetcwd = \&_msdos_cwd;
- *fastcwd = \&_msdos_cwd;
+ if ($^O eq 'VMS') {
+ *cwd = \&_vms_cwd;
+ *getcwd = \&_vms_cwd;
+ *fastcwd = \&_vms_cwd;
+ *fastgetcwd = \&_vms_cwd;
+ }
+ elsif ($^O eq 'NT' or $^O eq 'MSWin32') {
+ # We assume that &_NT_cwd is defined as an XSUB or in the core.
+ *getcwd = \&_NT_cwd;
+ *fastcwd = \&_NT_cwd;
+ *fastgetcwd = \&_NT_cwd;
+ }
+ elsif ($^O eq 'os2') {
+ # sys_cwd may keep the builtin command
+ *cwd = defined &sys_cwd ? \&sys_cwd : \&_os2_cwd;
+ *getcwd = defined &sys_cwd ? \&sys_cwd : \&_os2_cwd;
+ *fastgetcwd = defined &sys_cwd ? \&sys_cwd : \&_os2_cwd;
+ *fastcwd = defined &sys_cwd ? \&sys_cwd : \&_os2_cwd;
+ }
+ elsif ($^O eq 'msdos') {
+ *cwd = \&_msdos_cwd;
+ *getcwd = \&_msdos_cwd;
+ *fastgetcwd = \&_msdos_cwd;
+ *fastcwd = \&_msdos_cwd;
+ }
}
-$^W = $oldw;
# package main; eval join('',<DATA>) || die $@; # quick test