sub findsvg { my $app = shift; my @themes = ("hicolor/scalable/apps/", "Flat-Remix-Blue-Dark/apps/scalable/", "Papirus/32x32/apps/"); my $svg; foreach my $theme (@themes){ $svg = "/usr/share/icons/" . $theme . $app . ".svg"; -e $svg and return $svg; } return "/usr/share/icons/whiskermenu-manjaro.svg"; }