# further up in the code: my $dir = $ENV{HOME} . "/www/pix/gallery"; # this points to the only place we should be loading # images from. | | Loop through the directory and populate all the valid | file names into an array my $image=sprintf( "%s/%s",$dir,$imageStack[rand($top)]); # that picks a single name out of the list and prepends # the full path of the gallery directory to the name.