Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update rand_img.psgi

Rewrote list slice in scalar context to scalar access. No functional change, but probably easier for a novice to understand.
  • Loading branch information...
commit 191577f1bb2da00b73f6c3d169e23ada97bbd6b4 1 parent 2bc162e
@chromatic chromatic authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 rand_image/rand_img.psgi
View
4 rand_image/rand_img.psgi
@@ -11,7 +11,7 @@ my $img_dir = 'public/img';
get '/' => sub {
opendir my $dir, $img_dir or die $!;
my @imgs = grep { -f "$img_dir/$_" } readdir $dir;
- my $img = @imgs[rand @imgs];
+ my $img = $imgs[rand @imgs];
warn $img;
@@ -26,4 +26,4 @@ get '/test' => sub {
return '<img src="/" />';
};
-dance;
Please sign in to comment.
Something went wrong with that request. Please try again.