my $file = "META.yml";
-my $new_file = "META.yml-new";
use Maintainers qw(%Modules get_module_files get_module_pat);
my @CPAN = grep { $Modules{$_}{CPAN} } keys %Modules;
-my @files = ('lib/unicore/mktables', 'TestInit.pm',
+my @files = ('autodoc.pl', 'lib/unicore/mktables', 'TestInit.pm',
'Porting/Maintainers.pm', 'Porting/perldelta_template.pod',
map { get_module_files($_) } @CPAN);
my @dirs = ('cpan', 'win32', grep { -d $_ && $_ !~ /^cpan/ } map { get_module_pat($_) } @CPAN);
@dirs = map { " - $_" } sort { lc $a cmp lc $b } @dirs;
-my $fh = safer_open($new_file, $file);
+my $fh = open_new($file);
local $" = "\n";
print $fh <<"EOI";
@files
EOI
-safer_close($fh);
-rename_if_different($new_file, $file);
+close_and_rename($fh);