3 use vars qw($Is_W32 $Is_OS2 $Is_Cygwin $Is_NetWare $Needs_Write);
4 use Config; # Remember, this is running using an existing perl
6 # Common functions needed by the regen scripts
8 $Is_W32 = $^O eq 'MSWin32';
9 $Is_OS2 = $^O eq 'os2';
10 $Is_Cygwin = $^O eq 'cygwin';
11 $Is_NetWare = $Config{osname} eq 'NetWare';
16 $Needs_Write = $Is_OS2 || $Is_W32 || $Is_Cygwin || $Is_NetWare;
23 foreach $name (@names) {
25 chmod 0777, $name if $Needs_Write;
26 ( CORE::unlink($name) and ++$cnt
27 or warn "Couldn't unlink $name: $!\n" );
32 sub safer_rename_silent {
35 # Some dosish systems can't rename over an existing file:
37 chmod 0600, $from if $Needs_Write;
43 safer_rename_silent($from, $to) or die "renaming $from to $to: $!";