in reply to Re^3: tt2 with perl cgi and a csv file
in thread tt2 with perl cgi and a csv file

Its odd having more then one place to reply on a thread. Thanks for telling me what AoH is stiller, I should have thought of that. Well I am thinking about going the Catalyst route. It seems like overkill but I thought that about tt2 before I started making my own little template system. Does catalyst work well with tt2? It looks rather... big. Also it seems to talk about SQLite. Does it also work with mysql? I have mysql on my server for doing mail routing. Also if I do go the Catalyst route should I move the system to a DB? Does it have a prebuilt thing that does about what I am trying to do? I started this project with a mind to do a quick convert of my old mailer address book manager so I have not really looked into what is already made for this kind of thing. Thanks!

Replies are listed 'Best First'.
Re^5: tt2 with perl cgi and a csv file
by Your Mother (Archbishop) on Mar 28, 2008 at 06:28 UTC

    I don't want to candy coat it. Catalyst has a learning curve, the docs are badly out of sync in a few places right now, and DBIx::Class, the ORM of choice, also has a learning curve, probably steeper. Then there are deployment issues. A CGI is a snap. Deploying a Cat app can be easy-ish to difficult depending on the host/env.

    That said, once you're acquainted with the stuff it's just amazing how much more productive it makes you. Factor of 10 just thinking back to big projects without it. In fact, I did a gig in Cat in about two weeks that took something like 4 months to do without it and it was missing *many* safety and UI features the Cat app had.

    One of the best things about Catalyst is it is, unlike Rails, agnostic about everything that plugs into it. You like YAML? Your config files can be in it. Or JSON, or XML, or init, or Apache style, or anything. You want plain DBI, CDBI, DBIC, Rose::DB? You have your pick. You have Oracle, MySQL, Postgres, SQLite? Bring it on. You want TT or HTML::Template, or Jemplate, or whatever! You've got it. The caveat there being: the Cat community leans pretty heavily toward TT and DBIx::Class. SQLite is used in a lot of examples for its simplicity and portability; it's great for testing too. Few folks are running applications with it.

    It's a terrific community (or several, TT and DBIC have good lists too) with at least a couple of wonderful monks on the mailing lists. It's not always easy to get going but there is help available and once you're immersed, it really just raises your game tremendously.

      I guess I had a little to much fun sticking tags into my last post, I took so long you had another post waiting for me... So do I also need/want DBIx::Class? Once I am finished what files would I have? A .tt lib file for Catalyst and a .tt view file? Or a view file for edit one for search and one for edit? Although I kind of like going to the same url for list/search etc. Is there any quick start guide into this?

        Jump in here: Catalyst manual intro. It discusses the layout of files and application structure. I recommend DBIx::Class (abbreviated DBIC) and there is also Rose::DB looks great but I haven't tried yet. There is also a budding Catalyst wiki (that address might not be permanent) which has lots of goodies.

        Another thing I like about the Cat community is there is a serious approach to designing applications "correctly" (where correctly means extensibly and to standards). Something like a list/search would be best broken up. But it would be easy to use almost exactly the same code in the background (not duplicating it but "chaining" it or passing around a single result set and adding parameters as they are introduced... well, you see the learning curve starting to kick in).

Re^5: tt2 with perl cgi and a csv file
by stiller (Friar) on Mar 28, 2008 at 05:24 UTC
    Catalyst is very flexible. It defaults to using tt2 for a template system, but it will let you use others.

    Also it will let you move your data into any database system, or you can keep them in the csv-file. If you keep it in the csv-file you will still interface it as a database, using DBD::CSV. SQLite is often used while developing because it's lightweight and convenient, and the catalyst examples tend to use it. You can use any old database you want to.

    The Catalyst book and online examples will show you how to get your project done with very litle code, and with very much flexibility for further work.

      Ok,
      after reading "about" I am starting in on the "Intro". I just hope I get through enough to make something work soon.

      The book is only 4 months old! I will have to think about getting a copy. Thanks!

      P.S. Sorry about all the odd formatting I noticed how this little box took html and got a little too excited.