How can I create a "good" news scriptby bladx (Chaplain)
|on Jan 01, 2002 at 00:53 UTC||Need Help??|
bladx has asked for the
wisdom of the Perl Monks concerning the following question:
I am back at it again, trying to get this news script project (that I have been working on for the past week) to work. I know that the easiest way to create a simple news script (and what I mean by a "news script" is a Perl-based CGI script that displays items from a database key and value hash.) I would like to be able to somewhere in my code be able to split elements of each line using a deliminator of | to seperate items such as the date of creation of article, the author, the title, the news, the avatar to go along with it, etc. But my problem is, I can't figure out (even after reading through the DB_File manpage,) how to do this. Is there a much better way to do this rather than to split a value of a key? (i.e. I am thinking of doing it like this: I have a key, then a value of something like: title|date|author|news and I would like to be able to split each individual key up so that I can use these variables or refrences in the HTML template later. That way I can have like a box of information using each variable from each value.
This is what I was planning on doing to create this news script, but is there a way I am missing, on how to do this sort of thing, using Perl and DB_File and HTML::Template? I hope that this time I have explained more about what I am doing than my past latest posts. For further clarification, the current .pl file I am doing this in is here:
Is there a way I can split each value in this script somewhere? If there is another way that is better than this way, please let me know! I don't want to be using something that is either old, or something that does not work at all. Thanks for any help.
Edit ar0n -- title fix