From e9eec6cfcc4d38b8faf24a31d3d88aae7958fb2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Thu, 7 Mar 2024 16:25:03 +0100 Subject: [PATCH] Use local $~ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolás Ortega Froysa --- pacundo.pl | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pacundo.pl b/pacundo.pl index cb7cd57..6944a0f 100755 --- a/pacundo.pl +++ b/pacundo.pl @@ -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++; }