Want to create HTML with Perl when do I need web server?

Discussion in 'OT Technology' started by SubOptimal, Jul 8, 2009.

  1. SubOptimal

    SubOptimal New Member

    Joined:
    Jun 27, 2002
    Messages:
    4,410
    Likes Received:
    0
    I'm learning Perl and can do things like get data from remote computers and put it in an SQLite database. However, I want to create an HTML report using HTML::Template. I'm pretty sure I've seen people use a web server on localhost to display web pages, so I'm not sure at what point I'd need a web server if I'm just going to be creating pages locally.
     
  2. Limp_Brisket

    Limp_Brisket New Member

    Joined:
    Jan 2, 2006
    Messages:
    48,422
    Likes Received:
    0
    Location:
    Utah
    i've never used HTML::Template but i imagine you wouldn't need a web server if you were just saving your generated HTML files and viewing them in a web browser.
     
  3. SubOptimal

    SubOptimal New Member

    Joined:
    Jun 27, 2002
    Messages:
    4,410
    Likes Received:
    0
    As I understand it, HTML::Template is just used to keep HTML code out of Perl scripts. But, yeah that is pretty much it. I'd like to be able to query the database and generate an HTML report.

    It looks like I have to learn HTML and CSS. Are there any good web sites or books I should start with?
     
  4. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    http://www.catalystframework.org/

    Work through the tutorial, which can easily be done in SQLite. Post again if you have questions, I'm a Perl/Catalyst developer, just checked in my first module. Consider Template Toolkit.

    The manual is here: http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual.pm

    The tutorial is here: http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/Tutorial.pod

    The intro is here: http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/Intro.pod

    You can use the catalyst development server to serve dynamic pages from your localhost no problem. No web server needed.

    Check out cat in a box for a quick start: http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7001/lib/Catalyst/Manual/Installation.pod
     
    Last edited: Jul 8, 2009
  5. Limp_Brisket

    Limp_Brisket New Member

    Joined:
    Jan 2, 2006
    Messages:
    48,422
    Likes Received:
    0
    Location:
    Utah
    :hsugh:
     
  6. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    I will poop on your firstborn.
     
  7. Limp_Brisket

    Limp_Brisket New Member

    Joined:
    Jan 2, 2006
    Messages:
    48,422
    Likes Received:
    0
    Location:
    Utah
    okay, as long as you realize it's still a web server even if it's only serving pages to the localhost.
     
  8. Limp_Brisket

    Limp_Brisket New Member

    Joined:
    Jan 2, 2006
    Messages:
    48,422
    Likes Received:
    0
    Location:
    Utah
    and as far as the original question with HTML::Template, i imagine if you just printed the contents of the template with template->output or whatever it is to a file instead of stdout in your perl script, you could just view it without using a webserver.
     
  9. SubOptimal

    SubOptimal New Member

    Joined:
    Jun 27, 2002
    Messages:
    4,410
    Likes Received:
    0
    I saw a new book on Catalyst that is coming out soon on Amazon, but I don't know much about that framework. I'm fairly new to programming and I know nothing about web development.

    After reading a few chapters of those links I think Catalyst might be out of my capabilities for now. :( Would I have to learn to use something like Catalyst and how to create a database driven web site in order to create an HTML report from a SQLite database? I got to keep it simple because I can't do much else at this point. :hs:
     
  10. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    You can probably work the tutorial with CatInaBox. Try it :)
     
  11. SubOptimal

    SubOptimal New Member

    Joined:
    Jun 27, 2002
    Messages:
    4,410
    Likes Received:
    0
    OK that's good to know. Hopefully someday I'll get to the level where I can put something like Catalyst to use. Thanks for everyone's help! :)
     
  12. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    Doesn't sound like i was helpful, but ok!
     
  13. CrazyInteg

    CrazyInteg Honda-Acura.net OG

    Joined:
    Dec 30, 2000
    Messages:
    12,205
    Likes Received:
    3
    Location:
    Omaha
    lolz Peyomp do you go on the IRC channel?


    This fuckin guy Matt Trout
     
  14. SubOptimal

    SubOptimal New Member

    Joined:
    Jun 27, 2002
    Messages:
    4,410
    Likes Received:
    0
    Here is another stupid question... Would I need a web server if on the html page I created I had a form where you could enter an SQL query for the database and get the results back? And if I would need a web server, I know there is lighttpd for *nix, but what's the simplest for Windows?
     
  15. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    The simplest for windows... is one of the framework test servers, like the one I described.

    CrazyInteg: Yeah, I shit talk mst all the time.
     
  16. SubOptimal

    SubOptimal New Member

    Joined:
    Jun 27, 2002
    Messages:
    4,410
    Likes Received:
    0
    Well, I've never read anything about making a module before and that seems to be what is throwing me off with Catalyst. I also don't understand the purpose of 'action types' and when to use them. Do you have any pointers for me to learn Catalyst? How did you learn it?

    Edit: Hmm, it looks like I'd have to learn OOP to use Catalyst since it seems to rely on creating modules? I understand how to use OOP modules, but creating objects and blessing them I don't know much about yet.
     
    Last edited: Jul 12, 2009

Share This Page