When I use the code that you provided it prints out the entire script like this:
#!/usr/local/bin/perl ####################################################### # Tip of the Moment V2.2 # # This program is distributed as freeware. We are not # responsible for any damages that the program causes # to your system. It may be used and modified free of # charge, as long as the copyright notice # in the program that give me credit remain intact. # If you find any bugs in this program. It would be thankful # if you can report it to us at cgifactory@cgi-factory.com. # However, that email address above is only for bugs reporting. # We will not respond to the messages that are sent to that # address. If you have any trouble installing this program. # Please feel free to post a message on our CGI Support Forum. # Selling this script is absolutely forbidden and illegal. ################################################################## # # COPYRIGHT NOTICE: # # Copyright 1999-2000 CGI-Factory.com TM # A subsidiary of SiliconSoup.com LLC # # # Web site: http://www.cgi-factory.com # E-Mail: cgifactory@cgi-factory.com # Released Date: April 1, 2000 # # Tip of the Moment V2.2 is protected by the copyright # laws and international copyright treaties, as well as other # intellectual property laws and treaties. ################################################################### require "cfg.pl"; &tip; sub tip{ open (DAT,"<$messages_location/count.txt") || &error1("unable to open counts.txt"); if ($flock eq "y") { flock DAT, 2; } $dat = ; close (DAT); $dat++; srand (); $rand_num = rand($dat); $rand_num = int($rand_num); if ($rand_num=~ tr/;<>*|`&$!#()[]{}:'"//) { print "Content-type: text/html\n\n"; print "Security Alert! Action canceled.
\n"; print "Please don't use weird symbols\n"; exit; } open (DATA,"<$messages_location/$rand_num.txt") || &error; if ($flock eq "y") { flock data, 2; } @data = ; $data = ; close (DATA); print "Content-type: text/html\n\n"; print "$title\n"; if ($showdate==1) { print ""; &date; print ""; } print "
\n"; foreach $data (@data) { print "$data\n"; } print ""; exit; } sub error1{ $errors = $_[0] ; print "Content-type: text/html\n\n"; print "An error occured,
\n"; print "the error is $errors
\n"; print "reason: $!\n"; exit; } sub error{ print "Content-type: text/html\n\n"; print "$title\n"; if ($showdate==1) { print ""; &date; print ""; } print "
\n"; print "Nothing at this moment.\n"; print ""; if ($email=~ tr/;<>*|`&$!#()[]{}:'"//) { print "Content-type: text/html\n\n"; print "Security Alert! Action canceled.
\n"; print "Please don't use weird symbols\n"; exit; } open(MAIL,"|$mail_prog -t"); print MAIL "To: $email\n"; print MAIL "From: $email\n"; print MAIL "Subject: File NO. $rand_num is missing \n\n"; print MAIL "For some reasons, the file $rand_num.txt is missing.\n"; print MAIL "You may want to check your message database. :)\n"; close (MAIL); exit; } sub date { @months = ('January','February','March','April','May','June','July','August','September','October','November','December'); @days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime)[0,1,2,3,4,5,6]; $sec = sprintf("%.02d",$sec); $min = sprintf("%.02d",$min); $hour = sprintf("%.02d",$hour); $mday = sprintf("%.02d",$mday); $year += 1900; $date = "$days[$wday], $months[$mon] $mday, $year"; $date = "$days[$wday], $months[$mon] $mday, $year"; print "$date"; }
Donm