Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -wT
    use strict;
    ...
    # Call in img tag - e.g.: <img src="randimage.cgi" border="2">
    my @files = glob("./jpegs/*.jpg");
    print "Location: $files[int(rand @files)]\n\n";
    
  2. or download this
    #!/usr/bin/perl -wT
    use strict;
    ...
    my $file = URI->new_abs($files[int(rand @files)], "http://bugzilla");
    print "Status: 307 Temporary redirect\n";
    print "Location: $file\n\n";
    
  3. or download this
    #!/usr/bin/perl -wT
    use strict;
    ...
    binmode (STDOUT);
    print while(<IMG>);
    close IMG;