From f15382ae27ca68bab46059650dbdd12ac2216f32 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Fri, 16 Jun 2017 08:54:35 +0200 Subject: [PATCH 1/2] Use postderef instead of autoderef Unfortunately autoderef was removed in perl 5.24. --- xfce-xterm-launcher-update | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xfce-xterm-launcher-update b/xfce-xterm-launcher-update index d1b4c61..f5956aa 100755 --- a/xfce-xterm-launcher-update +++ b/xfce-xterm-launcher-update @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5.24; # for postderef use warnings; use strict; use File::Slurp; @@ -21,7 +22,7 @@ for (@desktop_files) { my @xterm_scripts = glob("$ENV{HOME}/bin/hosts/*"); @xterm_scripts = sort { -A $a <=> -A $b } @xterm_scripts; -@xterm_scripts = @xterm_scripts[0..31]; +@xterm_scripts = @xterm_scripts[0..31] if @xterm_scripts > 32; for my $xterm_script (@xterm_scripts) { my ($name) = $xterm_script =~ m{([^/]+)$}; if ($desktop_files{$name}) { @@ -98,7 +99,7 @@ sub replace { } open(my $fh, '>', $filename); print $fh "[Desktop Entry]\n"; - for my $k (sort keys $desktop_file->{content_fields}) { + for my $k (sort keys $desktop_file->{content_fields}->%*) { print $fh "$k=$desktop_file->{content_fields}{$k}\n"; } close($fh); From c07c42d53369a6536d3d70d5f07a4d784f13bfcd Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Fri, 16 Jun 2017 08:55:59 +0200 Subject: [PATCH 2/2] Create log dir if necessary --- xfce-xterm-launcher-log-age | 1 + 1 file changed, 1 insertion(+) diff --git a/xfce-xterm-launcher-log-age b/xfce-xterm-launcher-log-age index 14ccef0..1b1048c 100755 --- a/xfce-xterm-launcher-log-age +++ b/xfce-xterm-launcher-log-age @@ -12,6 +12,7 @@ my $launcher = $ARGV[0]; my $launcher_dir = "$ENV{HOME}/.config/xfce4/panel/launcher-$launcher"; my @desktop_files = glob("$launcher_dir/*.desktop"); +mkdir "$ENV{HOME}/log/"; mkdir "$ENV{HOME}/log/xfce-xterm-launcher/"; open my $log, ">>", "$ENV{HOME}/log/xfce-xterm-launcher/" . strftime("%Y-%m", localtime);