Miscellaneous > The Lounge
PHP or Perl?
reactosguy:
Which one should I go with?
My PHP scripts have been screwing up lately.
Perl is a bit insecure due to its CGI nature.
I need DB features.
PHP or Perl?
Refalm:
JSP ;)
You'd be amazed at how many webhosters support it. It's also very stable and secure.
Also on PHP, it's kind of a hacked together language, so it's up to the coder to find a way to structure all the code, or fuck up completely (which is easy with PHP if you're just fucking around).
Perl is a bit more structured, and a lot of good websites are built on it. I'm sure most of the CGI exploits have been fixed over the years, since Perl as webscript is older than PHP and ASP.
reactosguy:
--- Quote from: Refalm on 6 October 2010, 23:50 ---JSP ;)
--- End quote ---
Why don't you use a JSP-based forum if JSP works?
I need something that's not Java, because I heard Oracle is taking it over and making it proprietary. I also asked, PHP or Perl?
--- Quote from: Refalm on 6 October 2010, 23:50 ---Also on PHP, it's kind of a hacked together language, so it's up to the coder to find a way to structure all the code, or fuck up completely (which is easy with PHP if you're just fucking around).
--- End quote ---
True. PHP does take some concepts from other languages.
--- Quote from: Refalm on 6 October 2010, 23:50 ---Perl is a bit more structured, and a lot of good websites are built on it. I'm sure most of the CGI exploits have been fixed over the years, since Perl as webscript is older than PHP and ASP.
--- End quote ---
I agree. I'd rather use Perl over PHP because Perl gets CGI.pm, which makes CGI on Perl heck a lot easier!
I wonder, how do you connect to a MySQL database in Perl? I know part of it, but how do I slam the MySQL username and password in there?
Refalm:
Like this:
--- Code: ---#!/usr/bin/perl
# PERL MODULE WE WILL BE USING
use Mysql;
# MySQL CONFIG VARIABLES
$host = "localhost";
$database = "store";
$tablename = "inventory";
$user = "username";
$pw = "password";
--- End code ---
You need the MySQL module installed obviously.
reactosguy:
--- Quote from: Refalm on 7 October 2010, 09:39 ---Like this:
--- Code: ---#!/usr/bin/perl
# PERL MODULE WE WILL BE USING
use Mysql;
# MySQL CONFIG VARIABLES
$host = "localhost";
$database = "store";
$tablename = "inventory";
$user = "username";
$pw = "password";
--- End code ---
You need the MySQL module installed obviously.
--- End quote ---
I was thinking like this:
--- Code: ---$db_handle = DBI->connect(dbi:mysql:database, undef, undef);
--- End code ---
Page 368 of Perl In A Nutshell (1999, O'Reilly Media, ISBN 1-56592-286-7) taught me that, if you have it.
I could use your reply as well! It looks more up to date.
Navigation
[0] Message Index
[#] Next page
Go to full version