Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Stuff like Catalyst and CGI::Application are more equivalents of Zend Framework rather than PHP itself. In order to replicate the basic functionality for creating web pages that PHP offers "out the box" then you need two CPAN modules that should be available in every base Perl installation:</p> <pre><code>use CGI; use DBI; </code></pre> <p>Is all you really need. Now instead of:</p> <pre><code>$_POST['param'] $_GET['param'] </code></pre> <p>you have:</p> <pre><code>my $q = new CGI; $q-&gt;param('param'); # same for post or get </code></pre> <p>And instead of:</p> <pre><code>$dbh = mysql_connect('localhost', 'mysql_user', 'mysql_password'); $sth = mysql_query("SELECT 1 FROM table", $dbh); while($row = mysql_fetch_assoc($sth)) { // do something with $row } </code></pre> <p>You have:</p> <pre><code>my $dbh = DBI-&gt;connect('DBI:mysql:host=localhost;', 'mysql_user', 'mysql_password'); my $sth = $dbh-&gt;prepare("SELECT 1 FROM table"); $sth-&gt;execute(); while(my $row = $sth-&gt;fetchrow_hashref) { # do stuff with row } </code></pre> <p>The DBI code is slightly more complicated because it offers prepared statments and bound variables so that you don't need to worry about SQL injections. PHP doesn't offer this so you need to use something like PDO or write your own database class.</p> <p>The only thing left is if you wanted HTML output in a script. But you don't want that do you? You use HTML::Template or Template::Toolkit for that, the same way you should be using Smarty or native templates in PHP.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload