Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ChrisA

macrumors G5
Original poster
Jan 5, 2006
13,298
2,940
Redondo Beach, California
I don't usually do "web stuff". My background is embedded software, device drivers and so on. But now I need to make an HTML forms based front end to a few command line applications. This will be done with cgi-bin scripts. We don't care about design just as long as it works. There are only about four users so it's very low volume

I've prototyped some of this using Perl and CGI.pm and I'm impressed with how easy it was but then I've been using Perl from back when it was new.

OK, now a question: PHP seems to be more in fashion today than Perl for this kind of thing. What's the difference? I've read example PHP code and it looks a lot like Perl. Is there a good reason to use PHP over Perl? If there is I'll use this project as an excuse to learn.
 
If you already know Perl and it can get the job done, then I probably wouldn't worry about PHP. Depending on what you're doing though PHP can offer more speed over Perl, but not in all cases. Both languages have good resources around the web. I know both, about equally well, though still more at the intermediate level. I use both in my web development, though PHP generally for my site, and Perl for back-end things like doing logs and making backups run by cron. So yeah, both are the right tool for the job, it's just a matter of preference at this point.
 
PHP is better if you like to produce code that conforms to OO methodologies I would imagine. Although if you are more comfortable with Perl, it is probably best to stick with what you know and get the job done rather than mucking about.

As long as you (or someone else!) can maintain the code later on easily that is all that matters.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.