...

View Full Version : Perl or PHP; What script language,



effpeetee
07-12-2007, 08:09 AM
I expect that this question has been asked before, but it has become increasingly obvious to me that at my advanced age, I can't realistically learn both.

Which would be the easiest to learn. Not necessarily the most powerful.
Just the easiest to remember and use. :confused:

Your views would be helpful.

Frank - alias effpeetee

Fumigator
07-12-2007, 08:12 AM
My vote is PHP, based soley on my own experience. I set out to learn Perl, long long ago, and it never grabbed me. As soon as I wrote my first "Hello World" PHP script, I was hooked.

effpeetee
07-12-2007, 09:04 AM
My vote is PHP, based soley on my own experience. I set out to learn Perl, long long ago, and it never grabbed me. As soon as I wrote my first "Hello World" PHP script, I was hooked.
Thank you for your advice. My initial reaction is biased to php, but it will be interesting and helpful to find out others experiences.

Frank

felgall
07-12-2007, 09:15 AM
PERL is somewhat lower level than PHP and so you need a greater understanding of how the web actually works in order to write efficient PERL code. PHP is easier to get working because you can combine it more easily with HTML.

effpeetee
07-12-2007, 09:29 AM
PERL is somewhat lower level than PHP and so you need a greater understanding of how the web actually works in order to write efficient PERL code. PHP is easier to get working because you can combine it more easily with HTML.
What I am after also is a language that has some code that in itself helps to remember it's function.
Thus "save" in order to save. etc.
I find it difficult when I have learn that e.g. //? represents say "goto"

Although, I realise that there is more to it than that.

Frank

effpeetee
07-12-2007, 11:28 AM
Since I posted this question, I have been Googling around the internet. There seems no doubt that the best/easiest scripting language for me is PHP.

That is what I intend to go ahead with.

Thanks for your comments.

Frank

ralph l mayo
07-12-2007, 11:35 AM
Consider Ruby. It's practically a superset of Perl, plus it actually makes sense:



# Cheer
3.times { puts "Hooray!" }

# Play rock-paper-scissors
puts [ 'rock', 'paper', 'scissors' ].sort_by { rand }.first

# Split the first 100 positive integers into two groups of even and odd
evens, odds = (0..100).partition { |num| num % 2 == 0 }

# Don't let Rob in your web app b/c he is a jerk
exit if username.include?('Rob')

# Get and display the current top headlines via RSS
require 'rss'
news = RSS::Parser.parse(open('http://news.google.com/?output=rss').read)
news.items.each { |item| puts item.title }

# Imbue all integers with the ability to find their factorial
class Integer
def factorial
fact = 1
2.upto(self.abs) { |n| fact *= n }
return self < 0 ? -fact : fact
end
end
# This will output 120
puts 5.factorial

effpeetee
07-12-2007, 12:21 PM
Well!

QUOTE:
Consider Ruby. It's practically a superset of Perl, plus it actually makes sense:

You really have put the cat among the pigeons.

Python, Perl, PHP, Ruby.

Any others out there?

A very thoughful,

Frank.

firepages
07-12-2007, 01:14 PM
PHP was created to solve the `web problem` , its continued success suggests that it has.

PHP was originally written because PERL, whilst more than capable, made for lots of ugly and/or obfuscated code to do some simple everyday web-related routines.

Ruby & Python (google uses Python a LOT) have merit but neither I think are as user friendly as PHP (again this was its sole original purpose)

Other (proprietary) solutions would be JAVA, ColdFusion or ASP/.NET

If you add up usability, ease of use (without losing any `power`) support both commercial and community (and by support I also include ease/cost of hosting), its open source nature, plus the fact that finally people accept that it also scales very well thankyou very much ;) .. I find it hard to pass up PHP in most web related projects.

effpeetee
07-12-2007, 01:35 PM
It also has the added attraction that I have a book "Learning PHP and MySQL"
Also, I have a son in Casula in dear old Oz. (Not a logical argument.) But what the hell!

PHP has a Pretty High Priority to date.

Frank.

mlseim
07-12-2007, 03:03 PM
Frank ...

Glad you're still going into PHP mode ...

You'll discover that when you have various PHP scripts that do
different things like, read a file, write to a file, sessions, etc. you
will find yourself copying and pasting from one snippet of code
to another. So remembering codes and having to type everything
over again will not really be a problem.

You might also need a quick "lookup" on a PHP function ... that's where
you use Google. The word "PHP" first, then the function.

Example: PHP date

will bring up hits about the date function

If you want to get into reading the contents of a directory,
you might try a Google search like this:
http://www.google.com/search?hl=en&q=PHP+directory+contents&btnG=Google+Search

================

So, always keep another browser window open for your Google searches.

And, when you're stuck on something, ask in this forum.
(don't forget you can also email me)

Iszak
07-12-2007, 04:05 PM
I recommend PHP and not Ruby or Ruby on Rails, there is my vote. PHP is easy to start off with, Perl is powerful though, but the learning curve is eh, same with Ruby. As for python the tabs kill me, but it's all to do with personal preference in the end. If you want a easy learning curve, popular choose PHP. It you want power, but it takes some power to learn I'd suggest Perl, Python. If you want speed you'll want Ruby. But yeah personal preference.

effpeetee
07-12-2007, 04:14 PM
Hi! everyone.

Many thanks for your interesting and helpful advice.

I have however, after reading and considering, decided to go with PHP.
As I said earlier, I have the book and helpful advice from Max who uses this script.

I shall of course, ask for advice when I need it. (and that will be quite often)

Frank.

ralph l mayo
07-12-2007, 05:59 PM
It you want power, but it takes some power to learn I'd suggest Perl, Python. If you want speed you'll want Ruby.

No bearing on the original topic, and I may just be calling out a typo, but for the record the current Python implementation is much faster than the implementations of Ruby, Perl, or PHP because it uses Java-esque bytecode partial-compilation.

effpeetee
07-12-2007, 06:27 PM
ralph l mayo

Thanks for your input and advice. I will certainly look at Python. At 82 yrs old, my main concern is that it is easy to remember.

Is 'Python' at the server, or would I need to upload it.

Thanks also for the URL's

Frank



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum