Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Best way to create a perl website

by debiandude (Scribe)
on Aug 12, 2002 at 19:51 UTC ( #189607=perlquestion: print w/replies, xml ) Need Help??

debiandude has asked for the wisdom of the Perl Monks concerning the following question:

I have a nice website right now that I've worked on for a while. Its very modular and conforms to standards. However I wanted to upgrade it to have database interaction and such. I tried using php-nuke but I wasted most of my time deleting features that I didn't want rather than setting up my site. I don't need this kind of trouble. So basically I want to ask whats the best approch to desiging a whole site in perl. I have all the HTML. Its split into 3 section the top header, the left menu, and the middle content section. Should I create a giant moudle and end up doing something like print $page->header, $page->menum $page->content($data); Is that how sites like this do it? Any help would be appreciated. Is this sites code available for download. I tried looking at slashcode also but it was a little too much, again way more than I need. Simple site. Just use the database to retrive articles.

Replies are listed 'Best First'.
Re: Best way to create a perl website
by Tomte (Priest) on Aug 12, 2002 at 20:11 UTC

    FWIW:I would suggest a simple OO-approach, encapsulating the necessary DBI-code, for the article managment combined with a templating system like Template-Toolkit. I have recently realised a community-site for one of our customers using slashcode, you could reuse the TT<-->DB coupling code of it with a little bit of effort and would gain a very flexible site.

    You can find other, I assume more easily applicable templating systems searching CPAN.


    regards,
    tomte
Re: Best way to create a perl website
by DamnDirtyApe (Curate) on Aug 12, 2002 at 20:56 UTC

    This site runs on the Everything engine, which, AFAIK, you can download and play with all you want.

    I have to concur with the earlier posts that recommended Template Toolkit and CGI::Application, two excellent modules, IMO.

    I'm not sure what your Perl knowledge base is like, so I'll also mention that the DBI is where you want to look for talking to the database. There's a ton of tutorials out there for it, including here in the monastery.

    Have fun!


    _______________
    DamnDirtyApe
    Those who know that they are profound strive for clarity. Those who
    would like to seem profound to the crowd strive for obscurity.
                --Friedrich Nietzsche
Re: Best way to create a perl website
by fuzzyping (Chaplain) on Aug 12, 2002 at 20:19 UTC
    Just as there are limitless different types of "perl websites", there are limitless ways of creating them. I prefer using CGI::Application and (via inheritence) HTML::Template. CGI::Application for helping you think of the various tasks of your site in "run modes", while HTML::Template (CGI::Application::load_tmpl) helps you abstract your HTML code into template files. I absolutely *love* doing all of my sites this way now, but it may- may-not fit your needs.

    A fine introduction to CGI::Application can be found here, and one for HTML::Template here.

    -fp
•Re: Best way to create a perl website
by merlyn (Sage) on Aug 12, 2002 at 21:30 UTC
    Again, I'm a bit biased, but I think Template Toolkit is definitely the way to go. And if you're fetching articles from a database, it has a nice plugin to DBI, so it's relatively easy to do the fetching.

    There's also Moveable Type for story management though. I've not played with that, but some people really like it.

    -- Randal L. Schwartz, Perl hacker

      I love this place. Where else can you post a question by and have it answered by the person who wrote the book that taught you perl a few years ago. Anyway I've looked at some of your suggestions. Templete Toolkit does look nice. I going to have to map out excatly where I think I want to go and give each an extensive look to see which will make my travels least painful. I'll post back when I have the preliminary stuff done if anyone case to see how it turns out.
Re: Best way to create a perl website
by tjh (Curate) on Aug 13, 2002 at 16:03 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://189607]
Approved by Albannach
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2022-10-06 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (26 votes). Check out past polls.

    Notices?