I have one guestbook, simple itself, but writes new data to the end of the file. So the last messages is in the end and needs to scroll to see them. I want that it writes new entry to he beginning of the file. Is there some simple command that does this or... Well, part of this pl file is this (what i need to change): { open(BOOK, ">> $book_file"); print BOOK "<blockquote><b>Nimi</b>: $input{'name'}\n"; print BOOK "<br><b>E-Mail</b>: <a href=\"mailto:$input{'e-mail'}\">$input{'e-mail'}</a>\n"; print BOOK "<br><b>Kodulehekülg</b>: <a href=\"$input{'URL'}\">$input{'URL'}</a>\n"; print BOOK "<br><b>Kust tuli</b>: $input{'locale'}\n"; print BOOK "<br><b>Teade</b>: $input{'comments'}\n"; print BOOK "<hr></blockquote>\n"; close(BOOK); print "Location: $book_url\n\n"; exit; } }

I don't belive Japhy is either. If I'm reading the code corectly it is just plain ol perl. "unshift" I think just reads from bottom to top. So what ever you use to read the data output you will still get the same results. But I could be wrong.

Would it not be better to use SSI "Server side includes" for a guest book? Pointing to the script example that Japhy gives To include the txt file in the HTML file. This would give you a dynamic way to displaying the data from the txt file. Instead of directly writing to the HTML file. This would allow you to maintain the web site page a little easier. Just in case you are editing the page while the people are appending to it as well. You will find your self in some trouble unless you stop the Guest book while you work on the Web site.

Would that not use less resources/time than having to "compile" the guestbook first by using a second script? (not that it would be that noticable)

Just put the new data at the top of the txt file rather than the bottom...

The only reason I would think of not to just put it on the top would be in Japhy's example where you want to keep the data in cronological order top to bottom, but would like to view the most recent ones first...

Sure that would be just fine. You may want to consider using a small clean perl script instead of directly pointing to the txt file, well that is if would want to do some filtering on the file and like you said display from top to bottom. This would allow for some regex code to keep out things you do not want to diplay.

Also you will want to filter input becuase these types of service are known for Hacks.