Jump to content
xisto Community
Sign in to follow this  
neo_is

Questions On PHP Versus Perl-CGI

Recommended Posts

I have been working on perl -cgi for some time now. I have made a few dynamic webpages with perl-cgi.But recently I learnt about php. Every here and now, there is a mention of php.Can any one guide me on what are the advantages of php over perl-cgi- am I losing anything by avoiding php? (so that I dont have to spend time learning php)- are these languages used in entirely different domains? I am also not using the mySQL database but rather the files created by perl. All I could guess by now is that php offeres some better interface with SQL. am i right? But then SQL can be accesed by perl also.thanks for your timeneo

Share this post


Link to post
Share on other sites

PHP is said to be more resource conservative than perl. The difference isn't nothing huge and for normal dynamic webpages it's insignificant. The approach is a bit different. Both a scripting languages yes, but PHP is almost completely geared towards dynamic webpages. PHP has many features built in that are very handy for dynamic webpage use. Then again Perl has been around so long that lot of these things are availble for it. For example the database issue you mentioned: PHP has indeed very nice database interface but I'm sure you can find bunch of those for perl. Same goes for XML parsing except that PHP XML parse is not so nice. Don't know about perl implementrations. My opinion is that you are not really missing that much. On the other hand learning PHP shouldn't be too hard for you as it has been inflence with Perl quite a lot. If you're familiar with C too that you practicalyl alredy know PHP :P

Share this post


Link to post
Share on other sites

Agree with above and also could add that PHP scripting language was built from ground up with database functionality, mostly with MySQL. Perl wasn't meant for that. With PHP it is much faster to make web pages and parse HTML, Perl usually needs to print it or create some template system. PHP language is much more secure than Perl, Perl has more holes, well it is an older language.. PHP is much easier to learn, easier than most of other languages, even though it is similar to C and Perl, but being a master on PHP it is much easier to learn Perl or C language.. On Perl, you need to know what you're doing, sometimes people who use PHP, they don't know what they are doing, but they still get the result they want. I read somewhere, that PHP is faster than Perl, meaning the server won't have so much load, especially with all the Zend stuff.PHP has much more compiled functions than Perl, some think that it is good, some don't think so, because they need to remember much more, but in my opinion it is good. In Perl you need to write your own custom functions, you can do that in PHP too, but compiled functions work much faster. Sometimes I think that PHP development team, could add much more functions, which are really useful and usually needed.Furthermore, PHP can be insecure by default, that is why you need the knowledge to code in a good way and you need to configure the server the right to avoid problems. There are really a lot of bad scripts out there. Sometimes I see people writing such functions, for which I want to punch them, but I can't :P As I know PHP is widely used, even though a lot of cheap hosts still use PHP3 or PHP4 with bad/insecure configuration, so until most Servers won't be using PHP5 or PHP6 their progress don't really matter Today, but in the future..As I am often using PHP, I said more PHP advantages, but I really know that some guy who has a lot of Perl knowledge could say a lot of advantages about Perl.. I think Perl in some way is much powerful, but PHP these days isn't only a language for creating websites, even though I agree that it is its main point.To add, I read that Python is even better than Perl or PHP in some way, people who moved to PHP and later moved to Python said "Why didn't I use python before" it has a really good database interface and stuff, but I never used Python before, but looking forward to find time, even though I rather use it on applications than on creating web applications. In addition, I heard that Perl is really good for doing something, for one result and PHP for multiple stuff, Bulletin Boards and so on. ;)

Share this post


Link to post
Share on other sites

php is riddled with holes.. however it is faster, at least that's what i hear. I have also been avoiding been php.. probably time to start learning. Shouldn't be hard though I guess.

Share this post


Link to post
Share on other sites

Php being specificaly desined for the web and lots of the CGI's works and Perl convoluted syntax are droped-reply by mohammad

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.