All right, I think a lot of people are taking this question way too seriously. If you just want personal opinions for general situations, here's what this lowly monk typically does:

What is the ONE BEST way to query a database table and display it as a web page?

The Data::Table module:

use DBI; use CGI ':standard'; use Data::Table; use strict; my $dbh = DBI->connect(...); my $table = Data::Table::FromSQL( $dbh, "select * from mytable where myfield = ?", 'whatever'); print header, start_html('Results'), $table->html;

What is the ONE BEST way to identify a user?

Prompt for a user name and authenticate with a passsword if necessary. Or if you just want to guess at a userid, then you can look at the contents of the variable $< (see perlvar).

What is the ONE BEST way to create a web page?

The vim text editor.

Oh, you mean from within a Perl program? You can still write raw HTML code in a Perl program.

Or you could use the CGI module as I did earlier. I'll admit that this is what I typically do for dynamic web pages.

I'll also admit that when I'm creating tables I'll use the Data::Table or HTML::Table modules.

What is the ONE BEST way to edit a database record?

Assuming that you can use SQL, use it. Preferably via a DBI-like module:

$dbh->do("update table set blah = 'foo' where flurb = 'fleem'");

What is the ONE BEST way to query a database?

This is one I refuse to touch. It depends on what you're doing with the results. Querying is always pretty easy. It's using the results that can be tricky...

buckaduck


In reply to Re: The ONE way of the Web Page by buckaduck
in thread The ONE way of the Web Page by mdupont

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.