Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored August 18, 2013

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  rand_image/rand_img.psgi
4  rand_image/rand_img.psgi
@@ -11,7 +11,7 @@ my $img_dir = 'public/img';
11 11
 get '/' => sub {
12 12
     opendir my $dir, $img_dir or die $!;
13 13
     my @imgs = grep { -f "$img_dir/$_" } readdir $dir;
14  
-    my $img = @imgs[rand @imgs];
  14
+    my $img = $imgs[rand @imgs];
15 15
     
16 16
     warn $img;
17 17
     
@@ -26,4 +26,4 @@ get '/test' => sub {
26 26
     return '<img src="/" />';
27 27
 };
28 28
 
29  
-dance;
  29
+dance;

0 notes on commit 191577f

Please sign in to comment.
Something went wrong with that request. Please try again.