home *** CD-ROM | disk | FTP | other *** search
/ What CD? 20 / WPCFEB98.ISO / MULTI / HOTMETAL / CGI.Z / rand_img.pl < prev    next >
Perl Script  |  1997-06-20  |  870b  |  31 lines

  1. #! /bin/perl
  2. # Random Image Displayer
  3. # Version 1.2 Created by: Matt Wright
  4. # Created On: 7/1/95            Last Modified: 7/17/95
  5. # I can be reached at:  mattw@misha.net
  6. # Scripts Archive at:    http://worldwidemart.com/scripts/
  7. # The file README contains more information and installation instructions.
  8.  
  9. # Necessary Variables
  10.   $basedir = "http://yourserver/youruserid/images/";
  11.   #insert the names of your images here
  12.   @files = ("orangeba.gif","blueball.gif","greenbal.gif");
  13.  
  14. # Options
  15.   $uselog = 0; # 1 = YES; 0 = NO
  16.         $logfile = "/home/youruserid/public_html/piclog";
  17.  
  18.   srand;
  19.   $num = rand(@files); # Pick a Random Number
  20.  
  21. # Print Out Header With Random Filename and Base Directory
  22.   print "Location: $basedir$files[$num]\n\n";
  23.  
  24. # Log Image
  25.   if ($uselog eq '1') {
  26.      open (LOG, ">>$logfile");
  27.      print LOG "$files[$num]\n";
  28.      close (LOG);
  29.   }
  30. exit;
  31.