perl vs php for postgresql

Started by Johnalmost 25 years ago7 messagesgeneral
Jump to latest
#1John
vze23skh@verizon.net

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.

-John

#2Noname
liman@linux.sanyres.es
In reply to: John (#1)
Re: perl vs php for postgresql

On Tue, 22 May 2001 02:48:58 GMT, 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.

-John

Hello.
I'm using Php with PostgreSQL for almost a year now and it works fine out of
the box.
What distro?

--
Liman - liman@bad-adn.com
Linux User: 178001 (http://counter.li.org)

#3Craig Orsinger
cjorsinger@m5.earthlink_net.invalid
In reply to: John (#1)
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.

#4Jason Earl
jdearl@yahoo.com
In reply to: Craig Orsinger (#3)
Re: Re: perl vs php for postgresql

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/

#5Zak McGregor
zak@mighty.co.za
In reply to: John (#1)
Re: perl vs php for postgresql

On Tue, 22 May 2001 02:48:58 GMT
"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.

Check the following:
1 - Pg.pm is in your @INC, and has permissions sufficient for the user
executing the perl script to read it.
2 - have you tried perl -e shell -MCPAN as root, and then typing
"install DBD::Pg"?
3 - If you're running your perl script through a webserver, try also
running from command line & see what errors you get
4 - Try a simple perl script, eg perl -e 'use Pg; print "done\n";' and
see if that too gives problems
5 - verify the existance and permissions of Pg.so - it needs to be in
@INC as well, and I *think* it needs 755 perms.
6 - check your versions of Postgres & Pg.
7 - post short sample script and full complete errors if the above fails

HTH

Ciao

Zak

--
====================================================================
Zak McGregor
http://www.carfolio.com - Specifications of cars online. Over 7000!
--------------------------------------------------------------------
Of course my password is the same as my pet's name.
My macaw's name was Q47pY!3, but I change it every 90 days.
====================================================================

#6John
vze23skh@verizon.net
In reply to: Jason Earl (#4)
Re: Re: perl vs php for postgresql

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...

Show quoted text

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

#7Einar Karttunen
ekarttun@cs.Helsinki.FI
In reply to: John (#1)
Re: perl vs php for postgresql

On Tue, 22 May 2001, John 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.

Both perl and php are good alternatives. You should probably use the one
you are more familiar with. I think php is easier to learn, but once you
learned perl, it is IMHO more powerfull. If the application is very simple
php might be better, but if it is very complex I think perl is better.

- Einar Karttunen