PDA

View Full Version : Please for the love of god someone look my question this time!




Scav
04-14-2001, 02:49 PM
CGI/PERL:

open(FILE, "data/newsdata.cgi");
@newsdata = <FILE>;
close(FILE);

($postnum, $trash, $trash, $trash, $trash, $trash, $trash) = split(/|/, $newsdata[0]);
$postnum = "$postnum" + "1";

unshift(@newsdata, "$postnum|$title|$fullname|$email|$time|$date|$news");

open(FILE, ">data/newsdata.cgi");
flock(FILE, 2);
foreach $message (@newsdata) {

chomp $message;
print FILE "$message\n";

}
close(FILE);


the file i am having it open looks like this:

10|122222|Kevin Ulin|6944@home.com|1:50:39 am|04/10/01|2222
9|asdaaa|Kevin Ulin|6944@home.com|1:50:10 am|04/10/01|aaaaa
8|hmmm|Kevin Ulin|6944@home.com|1:47:59 am|04/10/01|adsf ohhhh ysa
7|test|Kevin Ulin|6944@home.com|1:46:20 am|04/10/01|test
6|123|Kevin Ulin|6944@home.com|1:46:03 am|04/10/01|123
5|asdf|Kevin Ulin|6944@home.com|1:42:51 am|04/10/01|asdf
4|asdf|fullname|email|1:41:36 am|04/10/01|asdf
3|a mere test|fullname|email|1:39:30 am|04/10/01|woohoo<br>
2|Just A Test|Kevin Ulin|6944@home.com|5:46 pm|4/8/01|This is a news post using cgi.
1|Second Test|Kevin Ulin|6944@home.com|5:46 pm|4/8/01|This is a news post using cgi.


the problem is the next line it makes is not 11, it is 2, help me!




Chako
04-14-2001, 05:02 PM
Scav, sorry to disappoint but I did see it the firs time, however I have 0 programming skills and hence can't help you...I post this so that you don't think your being ignored. Hopes someone helps you if they can

TotalRecall
04-14-2001, 08:53 PM
Sorry, I don't have the skillz either, Scav.

I did look over the code though, and you may try changing this :

$postnum = "$postnum" + "1";

to this:

$postnum = "$postnum" + "01";

This is only and uneducated guess. :p

TheeMon
04-14-2001, 09:13 PM
yeah 0 programing skills here to (ill learn very very soon though) cyaz