Re: "cook-ebook" - Should I use Perl or PHP/MySQL?
by davorg (Chancellor) on Feb 05, 2003 at 09:51 UTC
|
I would have thought that Perl with MySQL would be your best choice, but then I'm a little biased because I've never seen the point of PHP.
acme (who doesn't frequent PerlMonks any more) has over 100,000 recipes in his searchable database at http://astray.com/recipes/. Knowing him, it's probably implemented in Perl, MySQL and the Template Toolkit. I'm sure he'd be happy to share the code.
--
<http://www.dave.org.uk>
"The first rule of Perl club is you do not talk about
Perl club." -- Chip Salzenberg
| [reply] |
Re: "cook-ebook" - Should I use Perl or PHP/MySQL?
by theorbtwo (Prior) on Feb 05, 2003 at 10:00 UTC
|
As to PHP or Perl, the answer is to use the language that you're most comfortable writing it in. I suspect that's Perl.
As to it being beyond your technical expertise, I think you're overestimating how hard it will be. Consider using text files in some sort of standardized format, rather then going full-out, and using a database. \
Good luck with your project -- it sounds like a good one. Difficult enough to strech your skills, without being too difficult to be approachable. Most importantly, somthing you have actual use for.
Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).
| [reply] |
|
I'm assume that you are planning some kind of web interface.
I think that for most web based projects PHP is usually much simpler and the libraries you need are built in compared with perl where you would have to download and install them.
PHP is built from the ground up for producing web pages. I find web based stuff usually takes a fraction of the time to do in PHP than perl.
If you later decide to make the page public their are litterally hundreds of ISP's where your code will run without any alteration. A perl based solution would be A LOT MORE work.
On the other hand if it's not web based then perl is a few million times better.
| [reply] |
|
| [reply] |
Re: "cook-ebook" - Should I use Perl or PHP/MySQL?
by castaway (Parson) on Feb 05, 2003 at 10:14 UTC
|
Since I've no clue about PHP, I'd say use Perl :)
If you're looking to find out about using Databases in Perl, without figuring out bigger stuff like MySQL, then try DBD::SQLite. Looking at a good tutorial about designing databases is also a good idea.
On the other hand, if you don't then you can always just use flat files (CSV?), though that sounds like it might get a bit complicated with a lot of search-fields.
C. | [reply] |
Re: "cook-ebook" - Should I use Perl or PHP/MySQL?
by broquaint (Abbot) on Feb 05, 2003 at 11:24 UTC
|
If you're looking upon this opportunity as a learning experience then I would recommend going with Perl and your database of choice (which would appear to be MySQL in this case).
I recommend Perl over PHP for several reasons
- you have all the resources and community support of The Monastery
- the available introduction literature is superb (assuming you get the right stuff :)
- and lastly - learning PHP is no great joy. while it is very easy to pick up the basics and is somewhat simpler than perl in ways, learning PHP's subtle ins and outs is very tedious
I'd also recommend Preaching Perl gospel to PHP converts... for some good PHP vs. perl comparisons.
HTH
_________ broquaint | [reply] |
|
| [reply] |
Re: "cook-ebook" - Should I use Perl or PHP/MySQL?
by Wysardry (Pilgrim) on Feb 05, 2003 at 18:36 UTC
|
From your description, I'd say that using PHP would actually make things more complicated than they needed to be.
Although PHP can be used from the command line, that isn't really what it was designed for. In other words, you'd have to set up a Web server on your machine as well as PHP (and possibly MySQL).
Perl, on the other hand, is equally at home being called directly, or via a browser.
1000 recipes shouldn't be a problem using flat text files to hold the data, so you could keep things simple while you're learning, and then transition to a dedicated database system when you were more confident about doing so.
If installing and setting up Web server software doesn't worry you, I'd recommend using Apache (even on Windows) regardless of whether you choose Perl or PHP.
You might also want to look at Gossamer Threads' DBMan which is a Perl based database manager that uses flat text files and a browser interface. It is also available in a MySQL version, although that isn't particularly cheap.
It would give you a head start when designing your own system either way.
Oh, one last point. The PHP dev team seem to enjoy changing built in functions and/or default settings on a regular basis, thus breaking existing programs when the version is upgraded.
__________
"Every program has at least one bug and can be shortened by at least one instruction -- from which, by induction, one can deduce that every program can be reduced to one instruction which doesn't work." -- (Author Unknown)
| [reply] |
|
Why would she need a Web Server at all?
Just a lot of hype, is that ;)
C.
| [reply] |
Re: "cook-ebook" - Should I use Perl or PHP/MySQL?
by jacques (Priest) on Feb 05, 2003 at 14:00 UTC
|
Are you considering mod_perl? I think it's better to compare PHP to mod_perl than Perl.
In your situation, I think you should give PHP a twirl if you know less about it than Perl. Consider this project your chance to start learning another popular language. Your resume will thank you. | [reply] |
Re: "cook-ebook" - Should I use Perl or PHP/MySQL?
by mce (Curate) on Feb 05, 2003 at 10:35 UTC
|
Well,
since this site is called perlmonks and not phpmonks, I think you are asking the wrong persons what
our suggestion would be.
Ask the same question on a php group, and I know what their answer will be :-)
---------------------------
Dr. Mark Ceulemans
Senior Consultant
IT Masters, Belgium
| [reply] |
|
I'd like to think a little differently on this. While it is true that many of the users on this site will always say 'perl is the best language no matter what you need to do', I think you'd be surprised at the number of people who will give their honest opinion if they are well-educated in both Perl and the language in question (in this case, php).
Dare I say it? There are those few times when perhaps Perl is not the best option available for the job. And those who know the true differences between languages, as well as the strengths and weaknesses between them, are not going to lie about which option might be the most suitable.
Therefore, I think it is perfectly valid for a person to ask if maybe a certain task would be easily accomplished with another language. Remember: just because someone frequently visits perlmonks doesn't mean that they don't know anything else besides perl. I can't find it, but the perlmonks FAQ mentions somewhere that off-topic questions are generally well-accepted here because of the fact that Perl isn't the only thing we here know about :)
C:\>shutdown -s
>> Could not shut down computer:
>> Microsoft is logged in remotely.
| [reply] |
|
You have a valid point about most monks considering different languages equally and if the question was "Should I use Perl or C++" or something of that nature, your point would be validated. However, when you're asking about two languages, one of which is just a subset of another, which do you think people will reccomend?
| [reply] |
|
| [reply] |
Re: "cook-ebook" - Should I use Perl or PHP/MySQL?
by Aristotle (Chancellor) on Feb 06, 2003 at 12:55 UTC
|
| [reply] |