Re: Creating web pages using Perl.

2011-04-23 Thread David Christensen

On 04/23/2011 01:14 AM, Sean Murphy wrote:
> The perl script must generate plain 4.0 HTML code. I am not after any 
bells or whistles on the page.
> The Perl script will go through all my Audio books and group them by 
author, title and titles in series. I was thinking a table with the 
below columns:
> Author, Series, Title, stream, category  and rating. Rating is Adult, 
Junior, etc. Category is SiFi, thriller, etc.
> If the person clicks on the title, a brief description would pop-up. 
This would be a text file that it would show. Stream it would send the 
audio directly to the browser.
> the info would come from the directory structure of the audio books. 
I would run the script and it would build the web pages. So the HTML 
pages would be semi-static.


Compiled static HTML sites have distinct advantages, but if the site is 
low-bandwidth (e.g. personal/ LAN use) and/or you're library isn't too 
big, you might be able to accomplish your goal with a single CGI script. 
One advantage of a purely dynamic site is that you can create/ update/ 
delete data in the back end via whatever means and the current 
information will automagically appear via the front-end.



HTH,

David

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Creating web pages using Perl.

2011-04-23 Thread Shawn H Corey

On 11-04-23 09:09 AM, Peter Scott wrote:

It was very popular at one time although
templating makes a lot more sense.


It was very popular at one time because at one time, it was all there 
was.  :)



--
Just my 0.0002 million dollars worth,
  Shawn

Confusion is the first step of understanding.

Programming is as much about organization and communication
as it is about coding.

The secret to great software:  Fail early & often.

Eliminate software piracy:  use only FLOSS.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Creating web pages using Perl.

2011-04-23 Thread Peter Scott
On Sat, 23 Apr 2011 18:14:46 +1000, Sean Murphy wrote:
> 
> I am starting another project and I wish to know the best method of
> creating a web page via Perl. I don't want to reinvent the wheel here.
> The perl script must generate plain 4.0 HTML code. I am not after any
> bells or whistles on the page.
> 
> The Perl script will go through all my Audio books and group them by
> author, title and titles in series. I was thinking a table with the
> below columns:
> 
> Author, Series, Title, stream, category  and rating. Rating is Adult,
> Junior, etc. Category is SiFi, thriller, etc.
> 
> If the person clicks on the title, a brief description would pop-up.
> This would be a text file that it would show. Stream it would send the
> audio directly to the browser.

I find HTML::Template a good solution for the beginner who knows HTML. 
The Template Toolkit is awesome in its power but takes longer to learn 
for basic jobs like what you describe.  If and when you learn the 
Template Toolkit for some other reason then you're likely to use it for 
everything including tasks like this one.

The CGI.pm module can generate HTML via functions or methods with the 
same names as the elements.  It was very popular at one time although 
templating makes a lot more sense.

-- 
Peter Scott
http://www.perlmedic.com/ http://www.perldebugged.com/
http://www.informit.com/store/product.aspx?isbn=0137001274
http://www.oreillyschool.com/courses/perl3/

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Creating web pages using Perl.

2011-04-23 Thread Shlomi Fish
Hi Sean,

On Saturday 23 Apr 2011 11:14:46 Sean Murphy wrote:
> Hi all.
> 
> I am starting another project and I wish to know the best method of
> creating a web page via Perl. I don't want to reinvent the wheel here. The
> perl script must generate plain 4.0 HTML code. I am not after any bells or
> whistles on the page.
> 
> The Perl script will go through all my Audio books and group them by
> author, title and titles in series. I was thinking a table with the below
> columns:
> 
> Author, Series, Title, stream, category  and rating. Rating is Adult,
> Junior, etc. Category is SiFi, thriller, etc.
> 
> If the person clicks on the title, a brief description would pop-up. This
> would be a text file that it would show. Stream it would send the audio
> directly to the browser.
> 
> So is there any simple modules that would achieve this? I am not after a
> complex tool like the Ruby Rail project.
> 
> the info would come from the directory structure of the audio books. I
> would run the script and it would build the web pages. So the HTML pages
> would be semi-static.
> 
> Ideas and thoughts would be welcomed
> 

There are several solutions:

1. Template Toolkit:

http://perl-begin.org/uses/text-generation/#template-toolkit

The end-all and be-all of templating systems for Perl. Very powerful, but a 
little quirky.

2. You can also output XML and generate HTML (or XHTML) from it using XSLT.
«All problems in computer science can be solved by another level of 
indirection;» -- http://en.wikipedia.org/wiki/Indirection

3. Also see the other resources about text-generation on the link, and if 
you're interested in more complex directory structures, then look at IO::All ( 
http://search.cpan.org/dist/IO-All/ ) and similar modules. 

-

Some of these tools are complex and a bit error-prone, but they could be tamed 
(for example using http://search.cpan.org/dist/Template-Stash-AutoEscaping/ ). 
As I recently talked with a friend, I think that minimalist tools (i.e: ones 
that are kept minimal and useless on purpose) are not something we like, and 
that it's important that a tool will have a low-barrier for entry, and then 
have many dark corners, which users can find if they want that. But most 
programmers and power users want and need a lot of features.

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Stop Using MSIE - http://www.shlomifish.org/no-ie/

Every successful open-source project will eventually spawn a sub-project.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Creating web pages using Perl.

2011-04-23 Thread Sean Murphy
Hi all.

I am starting another project and I wish to know the best method of creating a 
web page via Perl. I don't want to reinvent the wheel here. The perl script 
must generate plain 4.0 HTML code. I am not after any bells or whistles on the 
page.

The Perl script will go through all my Audio books and group them by author, 
title and titles in series. I was thinking a table with the below columns:

Author, Series, Title, stream, category  and rating. Rating is Adult, Junior, 
etc. Category is SiFi, thriller, etc. 

If the person clicks on the title, a brief description would pop-up. This would 
be a text file that it would show. Stream it would send the audio directly to 
the browser.

So is there any simple modules that would achieve this? I am not after a 
complex tool like the Ruby Rail project.

the info would come from the directory structure of the audio books. I would 
run the script and it would build the web pages. So the HTML pages would be 
semi-static.

Ideas and thoughts would be welcomed

Sean 
If they click on the