3 # Ensure uncucddled else
6 open(my $old, "<$file") || do {
7 warn "Failed to open $file: $!\n";
11 open(my $new, ">$file.new") || do {
12 warn "Failed to create $file.new: $!";
18 if (/^(\s*)\}\s*(els(?:e|if)\b.*)/) {
32 rename($file, "$file.orig") || warn "Can't rename $file: $!";
33 rename("$file.new", $file) || warn "Can't rename $file.new: $!";
36 unlink("$file.new") || die "Can't unlink: $!";