home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Internet / WWW / Perl_WWW_Utilities / total / animation / nph-anim.pl next >
Encoding:
Perl Script  |  1996-01-01  |  1.3 KB  |  48 lines

  1. #!/usr/bin/perl
  2. # Animation Perl Script
  3. # Written by Matt Wright
  4. # Created on: 9/28/95   Last Modified on: 11/21/95
  5. # Version 1.2
  6. # I can be reached at:    mattw@misha.net
  7. # Scripts Archive at:    http://www.worldwidemart.com/scripts/
  8. # Consult the file README for more information and Installation Instructions.
  9.  
  10. #########################################################
  11. # Variables
  12.  
  13. $times = "1";
  14. $basefile = "/WWW/images/animation/";
  15. @files = ("begin.gif","second.gif","third.gif","last.gif");
  16. $con_type = "gif";
  17.  
  18. # Done
  19. #########################################################
  20.  
  21. # Unbuffer the output so it streams through faster and better
  22.  
  23. select (STDOUT);
  24. $| = 1;
  25.  
  26. # Print out a HTTP/1.0 compatible header. Comment this line out if you 
  27. # change the name to not have an nph in front of it.
  28.  
  29. print "HTTP/1.0 200 Okay\n";
  30.  
  31. # Start the multipart content
  32.  
  33. print "Content-Type: multipart/x-mixed-replace;boundary=myboundary\n\n";
  34. print "--myboundary\n";
  35.  
  36. # For each file print the image out, and then loop back and print the next 
  37. # image.  Do this for all images as many times as $times is defined as.
  38.  
  39. for ($num=1;$num<=$times;$num++) {
  40.    foreach $file (@files) {
  41.       print "Content-Type: image/$con_type\n\n";
  42.       open(PIC,"$basefile$file");
  43.       print <PIC>;
  44.       close(PIC);
  45.       print "\n--myboundary\n";
  46.    }
  47. }
  48.