in reply to Re: telling script to read from next line
in thread telling script to read from next line
Thanks to everyone who repsonded to this.#!/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 <FILE>; my @part = split(/\|/,$line); # Display the banner print "Content-type: text/html\n\n"; print "<font face=\"arial\" size=\"2\"><a href=\"@part[0]\" target +=\"_blank\"><img src=\"@part[1]\" width=\"@part[2]\" height=\"@part[3 +]\" alt=\"@part[4]\" border=\"1\"><br>Please visit my sponosr! </a></ +font>\n"; # Close the file close(FILE);
|
|---|