From: sgunderson@bigfoot.com <> Date: Fri, 9 Nov 2012 21:32:35 +0000 (+0100) Subject: Fix some Perl deprecation warnings. Patches from xim. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=290a2bdcb92997fd2537603dee5c67350b2bb7b1;hp=662fe6d7726767a409f5a15a37001c740849c641;p=pr0n Fix some Perl deprecation warnings. Patches from xim. --- diff --git a/perl/Sesse/pr0n/Index.pm b/perl/Sesse/pr0n/Index.pm index c813084..760e242 100644 --- a/perl/Sesse/pr0n/Index.pm +++ b/perl/Sesse/pr0n/Index.pm @@ -88,7 +88,7 @@ sub handler { my %settings = %defsettings; - for my $s qw(thumbxres thumbyres xres yres start num all infobox rot sel fullscreen model lens author) { + for my $s (qw(thumbxres thumbyres xres yres start num all infobox rot sel fullscreen model lens author)) { my $val = $apr->param($s); if (defined($val) && $val =~ /^(\d+)$/) { $settings{$s} = $val; diff --git a/perl/Sesse/pr0n/Templates.pm b/perl/Sesse/pr0n/Templates.pm index 3e65a9a..8bf0c1f 100644 --- a/perl/Sesse/pr0n/Templates.pm +++ b/perl/Sesse/pr0n/Templates.pm @@ -14,12 +14,11 @@ BEGIN { %EXPORT_TAGS = qw(); @EXPORT_OK = qw(); } -our %dirs; +our %dirs = (); sub update_dirs { my $r = shift; my $base = $r->dir_config('TemplateBase'); - %dirs = (); for my $dir (<$base/*>) { next unless -d $dir; @@ -33,7 +32,7 @@ sub update_dirs { sub r_to_dir { my $r = shift; - if (!defined(%dirs)) { + if (scalar(keys %dirs) == 0) { update_dirs($r); }