mason/.perl-lib/TrivGal.pm: Explicitly ignore values from `split_path'.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 21 Jun 2023 09:09:45 +0000 (10:09 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 21 Jun 2023 09:21:39 +0000 (10:21 +0100)
We frequently don't want all of the returns from `split_path'; indeed, I
think the BASE name is only used in one place.  Explicitly ignore these
by assigning to `undef' to make it clear what we do care about.

mason/.perl-lib/TrivGal.pm

index 2d65be5..96f66f1 100644 (file)
@@ -257,7 +257,7 @@ package TrivGal::Image {
          $m->interp->apply_escapes("$SCRIPTURL/$path", "u") .
          "?scale=$scale";
       } else {
-       my ($dir, $base, $ext) = TrivGal::split_path $thumb;
+       my ($dir, undef, $ext) = TrivGal::split_path $thumb;
        my $ty = $TYPE{lc $ext} or die "unknown type `$ext'";
 
        my $img = $me->{img};
@@ -344,7 +344,7 @@ sub listdir ($) {
          die "can't index a folder" if $indexp;
        } else {
          $list = \@f;
-         my ($dir, $base, $ext) = split_path $name;
+         my (undef, undef, $ext) = split_path $name;
          die "unknown image type" unless $TYPE{lc $ext};
          if ($indexp) {
            die "two index images" if defined $ix;
@@ -366,7 +366,7 @@ sub listdir ($) {
     closedir $d;
 
     ENT: for my $e (sort @e) {
-      my ($dir, $base, $ext) = split_path $e;
+      my (undef, undef, $ext) = split_path $e;
       my $dotp = $e =~ /^\./;
       my $st = stat "$path/$e";
       my $list = undef;