Use local $~

Signed-off-by: Nicolás Ortega Froysa <nicolas@ortegas.org>
This commit is contained in:
Nicolás A. Ortega Froysa 2024-03-07 16:25:03 +01:00
parent 1065595f6d
commit e9eec6cfcc

View File

@ -119,19 +119,16 @@ if (!$r_flag) {
print("Last changes:\n");
my $n = 1;
foreach my $tx (@undo_txs) {
if ($tx->{action} =~ /(upgraded|downgraded)/) {
format UPGRFORMAT =
format UPGRFORMAT =
@|| @<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<< -> @<<<<<<<<<<<<<
$n, $tx->{action}, $tx->{pkg_name}, $tx->{oldver}, $tx->{newver}
.
$~ = "UPGRFORMAT";
} else {
format INSTFORMAT =
format INSTFORMAT =
@|| @<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$n, $tx->{action}, $tx->{pkg_name}
.
$~ = "INSTFORMAT";
}
local $~ = ($tx->{action} =~ /(upgraded|downgraded)/) ? "UPGRFORMAT" : "INSTFORMAT";
write();
$n++;
}