Author Topic: PHP or Perl?  (Read 3113 times)

reactosguy

  • Member
  • **
  • Posts: 269
  • Kudos: 2
    • Microsoft Sucks !!!
PHP or Perl?
« on: 6 October 2010, 21:01 »
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

  • Administrator
  • Member
  • ***
  • Posts: 5,183
  • Kudos: 704
  • Sjembek!
    • RADIOKNOP
Re: PHP or Perl?
« Reply #1 on: 6 October 2010, 23:50 »
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.
« Last Edit: 6 October 2010, 23:53 by Refalm »

reactosguy

  • Member
  • **
  • Posts: 269
  • Kudos: 2
    • Microsoft Sucks !!!
Re: PHP or Perl?
« Reply #2 on: 7 October 2010, 01:08 »
JSP ;)

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?

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).

True. PHP does take some concepts from other languages.

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.

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

  • Administrator
  • Member
  • ***
  • Posts: 5,183
  • Kudos: 704
  • Sjembek!
    • RADIOKNOP
Re: PHP or Perl?
« Reply #3 on: 7 October 2010, 09:39 »
Like this:
Code: [Select]
#!/usr/bin/perl

# PERL MODULE WE WILL BE USING
use Mysql;

# MySQL CONFIG VARIABLES
$host = "localhost";
$database = "store";
$tablename = "inventory";
$user = "username";
$pw = "password";
You need the MySQL module installed obviously.

reactosguy

  • Member
  • **
  • Posts: 269
  • Kudos: 2
    • Microsoft Sucks !!!
Re: PHP or Perl?
« Reply #4 on: 7 October 2010, 21:01 »
Like this:
Code: [Select]
#!/usr/bin/perl

# PERL MODULE WE WILL BE USING
use Mysql;

# MySQL CONFIG VARIABLES
$host = "localhost";
$database = "store";
$tablename = "inventory";
$user = "username";
$pw = "password";
You need the MySQL module installed obviously.

I was thinking like this:
Code: [Select]
$db_handle = DBI->connect(dbi:mysql:database, undef, undef);

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.

piratePenguin

  • VIP
  • Member
  • ***
  • Posts: 3,027
  • Kudos: 775
    • http://piratepenguin.is-a-geek.com/~declan/
Re: PHP or Perl?
« Reply #5 on: 16 October 2010, 13:09 »
Why aren't you considering Python I'd like to know?
"What you share with the world is what it keeps of you."
 - Noah And The Whale: Give a little love



a poem by my computer, Macintosh Vigilante
Macintosh amends a damned around the requested typewriter. Macintosh urges a scarce design. Macintosh postulates an autobiography. Macintosh tolls the solo variant. Why does a winter audience delay macintosh? The maker tosses macintosh. Beneath female suffers a double scum. How will a rat cube the heavier cricket? Macintosh calls a method. Can macintosh nest opposite the headache? Macintosh ties the wrong fairy. When can macintosh stem the land gang? Female aborts underneath macintosh. Inside macintosh waffles female. Next to macintosh worries a well.

reactosguy

  • Member
  • **
  • Posts: 269
  • Kudos: 2
    • Microsoft Sucks !!!
Re: PHP or Perl?
« Reply #6 on: 16 October 2010, 19:05 »
Why aren't you considering Python I'd like to know?


Perl already has CGI.pm, amplifying forms. It makes CGI form processing simple. In addition, I am familiar with Perl, like my father.


Pyhton, on the other hand, is something I never want to get bitten by. My dad says that Python is another sub-par language used by fools.


PHP is easy to use and includes a lot of functions, but the "used more than max RAM" error is annoying me.


I should check into Python though. I've used Plone (another Python product), and it works great when you modify the Zope Database. In addition, Python doesn't require semicolons (Wikipedia said that) and it's growing.

piratePenguin

  • VIP
  • Member
  • ***
  • Posts: 3,027
  • Kudos: 775
    • http://piratepenguin.is-a-geek.com/~declan/
Re: PHP or Perl?
« Reply #7 on: 19 October 2010, 21:15 »
Python is used by Google and by NASA.
"What you share with the world is what it keeps of you."
 - Noah And The Whale: Give a little love



a poem by my computer, Macintosh Vigilante
Macintosh amends a damned around the requested typewriter. Macintosh urges a scarce design. Macintosh postulates an autobiography. Macintosh tolls the solo variant. Why does a winter audience delay macintosh? The maker tosses macintosh. Beneath female suffers a double scum. How will a rat cube the heavier cricket? Macintosh calls a method. Can macintosh nest opposite the headache? Macintosh ties the wrong fairy. When can macintosh stem the land gang? Female aborts underneath macintosh. Inside macintosh waffles female. Next to macintosh worries a well.

reactosguy

  • Member
  • **
  • Posts: 269
  • Kudos: 2
    • Microsoft Sucks !!!
Re: PHP or Perl?
« Reply #8 on: 9 November 2010, 05:33 »
My dad says that Python is outclassed. In reality, it's not; it's popular with corporations. Heck, even an MMORPG is made from Python. Sadly, I tried it, but my inexperience and failure with mod_python led me to ditch it.

In the end, I'm happier with PHP or Perl. Python was a great suggestion, but I need more experience on it.

piratePenguin

  • VIP
  • Member
  • ***
  • Posts: 3,027
  • Kudos: 775
    • http://piratepenguin.is-a-geek.com/~declan/
Re: PHP or Perl?
« Reply #9 on: 11 November 2010, 18:36 »
forget mod_python and learn how to use Pylons or Django. Python+mod_python is hardly comparable to PHP: that's a very low-level interface. Pylons provides a much MUCH simpler, and better envirnment

but yeah its up to you. if you're used to php, python will be a little bit different.
"What you share with the world is what it keeps of you."
 - Noah And The Whale: Give a little love



a poem by my computer, Macintosh Vigilante
Macintosh amends a damned around the requested typewriter. Macintosh urges a scarce design. Macintosh postulates an autobiography. Macintosh tolls the solo variant. Why does a winter audience delay macintosh? The maker tosses macintosh. Beneath female suffers a double scum. How will a rat cube the heavier cricket? Macintosh calls a method. Can macintosh nest opposite the headache? Macintosh ties the wrong fairy. When can macintosh stem the land gang? Female aborts underneath macintosh. Inside macintosh waffles female. Next to macintosh worries a well.