#!/usr/bin/perl | |
use strict; | |
my $ticket = $1 if $ENV{QUERY_STRING} =~ /(\d+)/; | |
$ticket = sprintf ("%08d", int (rand (100000000))) unless $ticket; | |
print "Content-type: image/jpeg\n\n"; | |
open (R, 'rand'); | |
while (<R>) { | |
chomp; | |
last if $_ ge $ticket; | |
} | |
system ("cat images/$_.jpg"); |