Обсуждение: Re: perl vs php for postgresql
In article <uskO6.1504$5G1.464213@typhoon2.ba-dsg.net>, "John" <vze23skh@verizon.net> wrote: > It seems that I having problems locating the DBM:Pg module. I even > followed the instructions on compiling postgresql to support it. My > perl scripts don't seem to know about a Pg module and I have not had any > luck finding answers. Is is easier to use php with postgresql? Will I > have the same kinds of problems? Thanks for any advice. I can't comment on the relative ease, but PHP is easy to use, at least for small projects like mine. I don't mean to start a flame war here, but Perl's syntax alwasy seemed a little obscure to me. I'm used to C and C-inspired shells. Not knowing anything about PHP, it took me about an hour to build a page that would display an HTML table from select, with color-coded rows. Not too bad for an occasional programmer.
The types of problems that John is having are quite likely to persist with PHP, as his problems aren't so much in programming with Perl, as it seems to be with compiling the requisite Perl modules. I haven't used PHP since PHP3, but if I remember correctly it was a lot more difficult to build a version of Apache that had a PostgreSQL compatible PHP module than it was to build DBD:Pg. John, if you really are trying to build the Perl module for PostgreSQL you need to get "DBD::Pg" (not DBM::Pg). You will also need the DBI module. Both of these can be found on CPAN, and the instructions are pretty complete (feel free to email me with specific questions). I would also second Craig's endorsement of PHP. It is exceptionally easy to use, and it performs well without having to learn to use mod_perl (I prefer Zope and Python, but that's another story). The cool thing about Perl, on the other hand, is that you can use it for your system adminstration tasks as well (yes, PHP can be used from the command line, but there is no better glue language than Perl). I find myself using it very frequently for tasks such as importing data into PostgreSQL and exporting data from PostgreSQL for use somewhere else. --- Craig Orsinger <cjorsinger@m5.earthlink_net.invalid> wrote: > In article > <uskO6.1504$5G1.464213@typhoon2.ba-dsg.net>, "John" > <vze23skh@verizon.net> wrote: > > > It seems that I having problems locating the > DBM:Pg module. I even > > followed the instructions on compiling postgresql > to support it. My > > perl scripts don't seem to know about a Pg module > and I have not had any > > luck finding answers. Is is easier to use php with > postgresql? Will I > > have the same kinds of problems? Thanks for any > advice. > > I can't comment on the relative ease, but PHP is > easy to use, at > least for small projects like mine. I don't mean to > start a flame war > here, but Perl's syntax alwasy seemed a little > obscure to me. I'm used > to C and C-inspired shells. Not knowing anything > about PHP, it took > me about an hour to build a page that would display > an HTML table > from select, with color-coded rows. Not too bad for > an occasional > programmer. > > ---------------------------(end of > broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://www.postgresql.org/search.mpl __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Jason, Thank you for the insightful post. I did make a typo when I typed DBM. I guess I was frazzled and really meant DBD. Since I eventuall want to open a socket and send some data to/from the database, you have made me realize (or remember) why I was using perl in the first place. Thanks. -John "Jason Earl" <jdearl@yahoo.com> wrote in message news:20010522194855.88731.qmail@web10008.mail.yahoo.com... > The types of problems that John is having are quite > likely to persist with PHP, as his problems aren't so > much in programming with Perl, as it seems to be with > compiling the requisite Perl modules. I haven't used > PHP since PHP3, but if I remember correctly it was a > lot more difficult to build a version of Apache that > had a PostgreSQL compatible PHP module than it was to > build DBD:Pg. > > John, if you really are trying to build the Perl > module for PostgreSQL you need to get "DBD::Pg" (not > DBM::Pg). You will also need the DBI module. Both of > these can be found on CPAN, and the instructions are > pretty complete (feel free to email me with specific > questions). > > I would also second Craig's endorsement of PHP. It is > exceptionally easy to use, and it performs well > without having to learn to use mod_perl (I prefer Zope > and Python, but that's another story). The cool thing > about Perl, on the other hand, is that you can use it > for your system adminstration tasks as well (yes, PHP > can be used from the command line, but there is no > better glue language than Perl). I find myself using > it very frequently for tasks such as importing data > into PostgreSQL and exporting data from PostgreSQL for > use somewhere else. > > --- Craig Orsinger > <cjorsinger@m5.earthlink_net.invalid> wrote: > > In article > > <uskO6.1504$5G1.464213@typhoon2.ba-dsg.net>, "John" > > <vze23skh@verizon.net> wrote: > > > > > It seems that I having problems locating the > > DBM:Pg module. I even > > > followed the instructions on compiling postgresql > > to support it. My > > > perl scripts don't seem to know about a Pg module > > and I have not had any > > > luck finding answers. Is is easier to use php with > > postgresql? Will I > > > have the same kinds of problems? Thanks for any > > advice. > > > > I can't comment on the relative ease, but PHP is > > easy to use, at > > least for small projects like mine. I don't mean to > > start a flame war > > here, but Perl's syntax alwasy seemed a little > > obscure to me. I'm used > > to C and C-inspired shells. Not knowing anything > > about PHP, it took > > me about an hour to build a page that would display > > an HTML table > > from select, with color-coded rows. Not too bad for > > an occasional > > programmer. > > > > ---------------------------(end of > > broadcast)--------------------------- > > TIP 6: Have you searched our list archives? > > > > http://www.postgresql.org/search.mpl > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Auctions - buy the things you want at great prices > http://auctions.yahoo.com/ > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly