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

Fellow Monks,

Having never written perl for a WWW environment I am bewildered by the range of modules available for this task. So far all I have been able to settle on is CGI::Simple

cmon toaster, details!


OK, so I'm investigating a replacement for our antiquated ftp transfer system, work in progress data is placed on an ftp site for clients to DL and (hopefully) approve. Presently we just provide links via email such as ftp://yourname@ftp.mydomain.com

I would like to try a web based system that

  • Presents a login screen to the user
  • Validates username/password and sets a cookie
  • Presents an html representation of the users available data
    Linked to the URLs of these files

  • Whilst I realise this is fairly simple, fellow monks will perhaps already be familiar w/ my highly shady use of <tags> here at PM - so looking for a module to handle this is desirable.


    To paraphrase , What should web newbies use to generate their HTML


    many thanks , toaster.
    HERE document!, doccy doccy doccy, HEEERE document.

    Replies are listed 'Best First'.
    Re: Simple HTML Generation: Please Advise
    by dws (Chancellor) on Nov 26, 2002 at 01:28 UTC
      To paraphrase , What should web newbies use to generate their HTML?

      HTML::Template, because

      1. You're going to end up using a template system eventually anyway, and
      2. It's easy to use, and
      3. Your life is so, so much easier when you do as little HTML in code as you can get away with.

      For the HTML I absolutely have to generate by hand, I use a combination of HEREDOCS, CGI.pm methods, and interpolated strings. Whichever is most readable.

    Re: Simple HTML Generation: Please Advise
    by dingus (Friar) on Nov 26, 2002 at 10:16 UTC
      CGI.pm already has lots of HTML tags and the like. I find the HTML generation using CGI.pm to be very simple and do 99% of what I want. The other 1% uses inline HERETO tags most of the time.

      However I suggest you (or your graphic designers /web page designers if you've them) produce a mock up page or 2 using a regular HTML generation scheme first. This allows you to get the order and layout and things right first. Then take that doc and translate it into CGI.pm equivalents, normally a short task.

      Also rememeber that an external stylesheet means that you can play with the content and let your more artistic colleagues handle the display.

      Dingus


      Enter any 47-digit prime number to continue.
    Re: Simple HTML Generation: Please Advise
    by jarich (Curate) on Nov 27, 2002 at 03:16 UTC
      First of all I approve whole heartedly about your choice of using CGI::Simple. As everyone would know the document for CGI.pm includes the paragraph:
      This module has grown large and monolithic. Furthermore it's doing many things, such as handling URLs, parsing CGI input, writing HTML, etc., that are also done in the LWP modules. It should be discarded in favor of the CGI::* modules, but somehow I continue to work on it.
      But, as you said, you'll need something else to handle HTML creation. I agree with dws that you should definately consider HTML::Template because you want to use templates of some description or another.

      Unfortunately no templating system can completely remove the requirement to create a certain amount of HTML yourself. You can either use heredocs or something else... if you're using CGI::Simple, I'd suggest looking at XML::Generator or, if you really want something more like what CGI lets you do HTML::AsSubs. XML::Generator refers to HTML::Generator which sounds ideal but doesn't seem to exist. :(

      Of course for a simple suggestion as you've asked HTML::Seamstress might also be interesting.

      Hope these help.

      jarich