#!/usr/bin/perl -wT use strict; use CGI; my $line = ""; my $part = ""; my $adfile = 'banners.dat'; open(FILE, $adfile) || die "Can't open $adfile"; #srand; # This chooses a random line, and puts that line into # the var $line. rand($.) < 1 && ($line = $_) while ; # This gets rid of the space at the end on each line chop $line; # Now you can split it my @part = split(/\|/,$line); # Close the file close(FILE); # Display the banner print "Content-type: text/html\n\n"; print "\"@part[4]\"
Click here to visit my sponsor!
\n";