Any good Perl coders out there?

A

amerar

Hi All,

I need to convert a PHP script into Perl. This PHP script interacts
with our Oracle database. It executes some stored procedures and
returns values. I've pasted the PHP code below, I'm just not sure how
to code it in Perl & DBI. Can anyone help?? I would really
appreciate it.

PHP CODE
----------------
$conn = ociplogon("scott", "tiger", "ABCD.world");
$curs = OCINewCursor($conn);
$stmt = OCIParse($conn,"BEGIN AUTO_CHARGE.EXP_RENEW_SUBSCR:)data);
end ;");
ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
ociexecute($stmt);
ociexecute($curs);

while (OCIFetchInto($curs,&$data)) {
$customer_id = $data[0];
$owner_name = $data[1];
$type = $data[2];
$code = $data[3];
..
..
..
}
 
M

Michael Vilain

Hi All,

I need to convert a PHP script into Perl. This PHP script interacts
with our Oracle database. It executes some stored procedures and
returns values. I've pasted the PHP code below, I'm just not sure how
to code it in Perl & DBI. Can anyone help?? I would really
appreciate it.

PHP CODE
----------------
$conn = ociplogon("scott", "tiger", "ABCD.world");
$curs = OCINewCursor($conn);
$stmt = OCIParse($conn,"BEGIN AUTO_CHARGE.EXP_RENEW_SUBSCR:)data);
end ;");
ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
ociexecute($stmt);
ociexecute($curs);

while (OCIFetchInto($curs,&$data)) {
$customer_id = $data[0];
$owner_name = $data[1];
$type = $data[2];
$code = $data[3];
.
.
.
}

Gee, your boss should know you're in over your head and completely
incompetent. Where do you work?
 
A

amerar

I need to convert a PHP script into Perl. This PHP script interacts
with our Oracle database. It executes some stored procedures and
returns values. I've pasted the PHP code below, I'm just not sure how
to code it in Perl & DBI. Can anyone help?? I would really
appreciate it.
PHP CODE
----------------
$conn = ociplogon("scott", "tiger", "ABCD.world");
$curs = OCINewCursor($conn);
$stmt = OCIParse($conn,"BEGIN AUTO_CHARGE.EXP_RENEW_SUBSCR:)data);
end ;");
ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
ociexecute($stmt);
ociexecute($curs);
while (OCIFetchInto($curs,&$data)) {
$customer_id = $data[0];
$owner_name = $data[1];
$type = $data[2];
$code = $data[3];
.
.
.
}

Gee, your boss should know you're in over your head and completely
incompetent. Where do you work?

I think your Father sexually abused you, which is why you have such a
disgusting personality.
 
C

Chris Scholz

Hi All,

I need to convert a PHP script into Perl. This PHP script interacts
with our Oracle database. It executes some stored procedures and
returns values. I've pasted the PHP code below, I'm just not sure how
to code it in Perl & DBI. Can anyone help?? I would really
appreciate it.

http://learn.perl.org/
 
M

Michael Vilain

I need to convert a PHP script into Perl. This PHP script interacts
with our Oracle database. It executes some stored procedures and
returns values. I've pasted the PHP code below, I'm just not sure how
to code it in Perl & DBI. Can anyone help?? I would really
appreciate it.
PHP CODE
----------------
$conn = ociplogon("scott", "tiger", "ABCD.world");
$curs = OCINewCursor($conn);
$stmt = OCIParse($conn,"BEGIN AUTO_CHARGE.EXP_RENEW_SUBSCR:)data);
end ;");
ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
ociexecute($stmt);
ociexecute($curs);
while (OCIFetchInto($curs,&$data)) {
$customer_id = $data[0];
$owner_name = $data[1];
$type = $data[2];
$code = $data[3];
.
.
.
}

Gee, your boss should know you're in over your head and completely
incompetent. Where do you work?

I think your Father sexually abused you, which is why you have such a
disgusting personality.

Actually, IIRC, it was your father. I recall a mole on his left buttock
and another in an improbable and generally hard to access location. Oh,
and your mom says "Hello". But I degress.

There are CPAN libraries you can download and build to add Oracle
connectivity to your perl installation. Writing the code won't help you
if your perl installation doesn't know how to access the database.
Start by using Google to find sites that describe what you're attempting
to do (rather than get someone else to do it for you).

http://www.perl.com/pub/a/2003/10/23/databases.html
http://www.xml.com/pub/a/2000/12/13/perlxmldb.html

Seriously, if you expect someone to do your homework or job for you
without the slightest shred of effort on your part, you're going to be
sadly disappointed in this life. Where do you work?
 
T

Timo Jokinen

Michael said:
Hi All,

I need to convert a PHP script into Perl. This PHP script interacts
with our Oracle database. It executes some stored procedures and
returns values. I've pasted the PHP code below, I'm just not sure how
to code it in Perl & DBI. Can anyone help?? I would really
appreciate it.

PHP CODE
----------------
$conn = ociplogon("scott", "tiger", "ABCD.world");
$curs = OCINewCursor($conn);
$stmt = OCIParse($conn,"BEGIN AUTO_CHARGE.EXP_RENEW_SUBSCR:)data);
end ;");
ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
ociexecute($stmt);
ociexecute($curs);

while (OCIFetchInto($curs,&$data)) {
$customer_id = $data[0];
$owner_name = $data[1];
$type = $data[2];
$code = $data[3];
.
.
.
}

Gee, your boss should know you're in over your head and completely
incompetent. Where do you work?
Sorry but if you doesn't want to help him/her don't bother to
write your sarcastic's answer's.

cheers
-timppa
 
J

Jamie

In said:
Michael said:
Hi All,

I need to convert a PHP script into Perl. This PHP script interacts
with our Oracle database. It executes some stored procedures and
returns values. I've pasted the PHP code below, I'm just not sure how
to code it in Perl & DBI. Can anyone help?? I would really
appreciate it.

PHP CODE
----------------
$conn = ociplogon("scott", "tiger", "ABCD.world");
$curs = OCINewCursor($conn);
$stmt = OCIParse($conn,"BEGIN AUTO_CHARGE.EXP_RENEW_SUBSCR:)data);
end ;");
ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
ociexecute($stmt);
ociexecute($curs);

while (OCIFetchInto($curs,&$data)) {
$customer_id = $data[0];
$owner_name = $data[1];
$type = $data[2];
$code = $data[3];
.
.
.
}
Sorry but if you doesn't want to help him/her don't bother to
write your sarcastic's answer's.

Well said!

This is part of the reason perl is loosing ground to other languages like PHP.


Here we have a perfectly good opportunity to introduce someone to the wonders
of perl and we've thrown it away. The original poster will probably walk away
from all this thinking

"Perl? phew! no thanks!"


As far as offering a helpful answer, (to the original post) what you'll want to
do is check out the DBI and DBD modules at your friendly neighborhood CPAN
archive.

DBI is the modern way perl programs communicate with databases, DBI is a
generic interface. DBD is the actual database driver for it. (there is
one DBI and separate DBD's for each particular database.)

You'll find that with with the standard interface of DBI, porting your
application to other databases is a bit easier.

Do a 'perldoc DBI' for the details, it's quite easy once you get around to
understanding statement handles and connection handles. (these are a bit like
Resource handles of PHP)

You'll also want to glance over the DBD driver for oracle to find the connection
string details.

Jamie
 
K

Keith Keller

In <[email protected]>,


Well said!

This is part of the reason perl is loosing ground to other languages like PHP.

I'm sure you have data to support this claim!

(not advocating answering questions sarcastically, I just doubt your
claim)

--keith
 
M

Michael Carman

fishfry:

If you think that all Perl is good for is CGI, then you have a lot to learn.

If it means one less person coming here looking for someone do to their
job/homework for them the old timers will be pleased.
This newsgroup has had an attitude problem from day one.

It can be blunt at the best of times, but you shouldn't take that personally.

As far as "help me!" threads go, I'd rather scare off the gimme gimme crowd (who
have nothing to contribute) than drive away the experts.

The people here are very happy to help *if* you make a genuine effort to figure
things out yourself first. Repeat after me: "Usenet is not a helpdesk."
A PHP programmer comes here with a request for a how-to on the standard db
connection/retrieval syntax...

It didn't look that way to me. It looked like he wanted someone to write the
code for him. There's nothing wrong with that, but those sorts of things belong
in a jobs newsgroup, not a discussion one.

-mjc
 
U

Uri Guttman

f> I'm happy to add a hearty Me Too to this thread. This newsgroup has
f> had an attitude problem from day one. I don't know if the
f> newsgroup's attitude correlates with the decline of Perl as a
f> development language; but it certainly isn't helping any.

perl isn't in any decline. just that more kiddies who can't code are
using php. fine with us. perl is used for much more outside the web
anyhow. ever heard php called the ducttape of the internet?

f> A PHP programmer comes here with a request for a how-to on the
f> standard db connection/retrieval syntax; and he gets a hearty ****
f> YOU from several different people. It's really sad.

well, did you try to help him? no. the bitching types are always the
ones who never offer help. 100% of the time this is the case. so you
help all those php kiddies who wander into here asking for help. notice
that they don't ask in the php groups since they are populated by more
of the kiddies who cut/paste and don't know actually how to
program. everyone comes to the perl group as they claim we are
smarter. hmmm, smarter coders use perl but perl is losing ground. sounds
like the kiddies are learning that php is not as good as they hoped and
they will never learn more from their fellow php kiddies. too bad.

uri
 
U

Uri Guttman

f> In article <[email protected]>,

f> Just look at the Craigslist help-wanteds.

and look at jobs.perl.org. i bet the job levels are signifigantly higher
for the perl jobs as for the php kiddie jobs. notice how many of the
perl jobs want stuff beyond the web and academic backgrounds. i would
find it amusing to see a php job which wanted a BS in computer
science. when you grow up you will want a perl job.

uri
 
K

Keith Keller

and look at jobs.perl.org. i bet the job levels are signifigantly higher
for the perl jobs as for the php kiddie jobs. notice how many of the
perl jobs want stuff beyond the web and academic backgrounds. i would
find it amusing to see a php job which wanted a BS in computer
science. when you grow up you will want a perl job.

s/when/if/;

--keith
 
J

Jamie

In said:
perl isn't in any decline. just that more kiddies who can't code are
using php. fine with us. perl is used for much more outside the web
anyhow. ever heard php called the ducttape of the internet?

I'd still say perl *is* in decline, certainly in regards to small
business use. Definately in regards to the jobs I run across these days.

Seems pretty obvious to me.

In the past, perl was used a lot by smaller businesses (and even hobby websites)
I know this, because I took on a lot of perl projects in those days. Nowadays,
those jobs are all but gone, replaced with PHP.

Webmasters and people who used to hire "perl monkeys" now look to PHP, I've
spoken with them about doing stuff in perl, they often tell me it would be a
"step backwards".

Now, you and I know perl is /NOT/ a step backwards! but it doesn't matter, we're
not the customer. It's all about perception.

This is a big deal for anyone looking for smaller contracts.
f> A PHP programmer comes here with a request for a how-to on the
f> standard db connection/retrieval syntax; and he gets a hearty ****
f> YOU from several different people. It's really sad.

well, did you try to help him? no. the bitching types are always the
ones who never offer help. 100% of the time this is the case. so you

I'm "bitching" about the overall attitude... and I did offer to help the original
poster. Hope you understand my motive though, I like perl.. a lot.. I want
it to be used everywhere.

I know people who will not use perl because the perception is that perl
programmers are jerks. (same with apple, unix and particularly linux)
everyone comes to the perl group as they claim we are
smarter. hmmm, smarter coders use perl but perl is losing ground. sounds
like the kiddies are learning that php is not as good as they hoped and
they will never learn more from their fellow php kiddies. too bad.

I don't believe anyone claims perl coders are "smarter" except maybe the
perl coders themselves.

Although... I'd agree with the perl coders :)

That aside, let them ask, don't assume they're stupid, could be they're just
seeking out a little human connection, could be they are overwhelmed by
all the available documentation.

Whats more, there's no law saying anyone has to answer something they don't
feel like answering.

Bottom line, if you're someone who likes perl and wants more perl
opportunities for everyone... be nice to people.

BTW, uri, I heard you on perlcast, good job!


Jamie
 
M

Mirco Wahab

Jamie said:
I'd still say perl *is* in decline, certainly in regards to small
business use. Definately in regards to the jobs I run across these days.

No, Perl surely isn't in any decline. It's acceptance is.
The "BAF" (beginners acceptance factor) of Perl is quite low.
Webmasters and people who used to hire "perl monkeys" now look to PHP, I've
spoken with them about doing stuff in perl, they often tell me it would be a
"step backwards".

They'd probably "decide" somehow to avoid any technology
which doesn't have any hype at all. That technology wouldn't
(predictably) attract a lot of new soldiers, so its possibly
doomed. Wouldn't you feel that way too (If you weren't you?) ...


Regards

Mirco
 
J

Jamie

In said:
No, Perl surely isn't in any decline. It's acceptance is.
The "BAF" (beginners acceptance factor) of Perl is quite low.

How can acceptance be low without perl itself being in decline? Please
don't misunderstand, I actually want to agree with you.

In case anyone wonders.. I'm not suggesting perl will ever go away, it's used
in so many other places that it'll always be around.
They'd probably "decide" somehow to avoid any technology
which doesn't have any hype at all. That technology wouldn't
(predictably) attract a lot of new soldiers, so its possibly
doomed. Wouldn't you feel that way too (If you weren't you?) ...

Well, that is basically my point. It's all about perception.

Your point is well taken, which explains why some of them are starting
to get a little loopy about "ruby" (I haven't messed with it yet, but have
read a bit of the docs for it, it definately reads like they've had
some serious PR folk working in the ruby trenches)

One thing I've run into with some people is that perl is "old" php is "new"
and the thing to do is "upgrade" to PHP. Newer is better. (regardless of
whether or not it actually is)

While it's pretty easy to debate a point like that, one doesn't score any
sales points by aggressively pounding facts into a potential client. Much as
one doesn't gain new users by insulting them. A person who does this may
be "right" but they'll still loose. (and in this case, we all loose)

Jamie
 
T

Tad McClellan

fishfry said:
In said:
Michael Vilain wrote:
I'm happy to add a hearty Me Too to this thread.


I agree that this OP was treated poorly.

This newsgroup has had
an attitude problem from day one.


You mean since 1995?

Or do you mean since _your_ day one here?

Or was that just a figure of speech?

clp.misc used to be a much nicer place than it is now.

I don't know if the newsgroup's
attitude correlates with the decline of Perl as a development language;


It has an *inverse* correlation to the popularity of Perl as a
development language.

Before "Perl = CGI" it was a bunch of like-minded programmers helping
each other.
 
C

Charlton Wilbur

J> In the past, perl was used a lot by smaller businesses (and
J> even hobby websites) I know this, because I took on a lot of
J> perl projects in those days. Nowadays, those jobs are all but
J> gone, replaced with PHP.

Yes, PHP is easier to write toy websites in. This has a lot to do
with mod_php being installed by default on most cut-rate web hosts,
and a lot to do with the false economy of PHP.

J> Webmasters and people who used to hire "perl monkeys" now look
J> to PHP, I've spoken with them about doing stuff in perl, they
J> often tell me it would be a "step backwards".

Unfortunate; if they're not willing to listen to technically skilled
people I don't think they're the kind of people I want to work for.

J> I know people who will not use perl because the perception is
J> that perl programmers are jerks. (same with apple, unix and
J> particularly linux)

If they don't want to use a superior product because their feelings
get hurt, it's really their loss. If they want to show up here and
write code for the gimme-gimme posters, they're more than welcome to.

In other words: you have the ability to post to this newsgroup too.
If you don't like what other people are posting, post more of what you
want to see. Put up or shut up.

Charlton
 
U

Uri Guttman

J> I'd still say perl *is* in decline, certainly in regards to small
J> business use. Definately in regards to the jobs I run across these days.

J> Seems pretty obvious to me.

then you are not looking for the right jobs :)


J> In the past, perl was used a lot by smaller businesses (and even
J> hobby websites) I know this, because I took on a lot of perl
J> projects in those days. Nowadays, those jobs are all but gone,
J> replaced with PHP.

smaller businesses don't count. they will always use the easy way out.

J> Webmasters and people who used to hire "perl monkeys" now look to
J> PHP, I've spoken with them about doing stuff in perl, they often
J> tell me it would be a "step backwards".

that is all web stuff. perl is used for much more non-web stuff than web
stuff. ever see a sysadmin use php to glue stuff?

J> I know people who will not use perl because the perception is that perl
J> programmers are jerks. (same with apple, unix and particularly linux)

and certified redmond kiddies are morons. bfd.

J> I don't believe anyone claims perl coders are "smarter" except maybe the
J> perl coders themselves.

you haven't been around enough perl media. try irc sometimes and that is
what happens a lot. "oh, no one is in #otherchannel or they are too
dumb, help me with this regex. perler all know regexes better"

i think that is because perl hackers understand that regexes are a
language and we usually know other langs. too many kiddies barely know
php so regexes are greek to them.

J> That aside, let them ask, don't assume they're stupid, could be
J> they're just seeking out a little human connection, could be they
J> are overwhelmed by all the available documentation.

or not use to being a professional programmer. simpler answer. smarts
isn't the only thing. wanting to know how to program and putting in the
effort is major. just being a php/html monkey doesn't TEACH you much
other than bad coding habits.

J> Whats more, there's no law saying anyone has to answer something they don't
J> feel like answering.

then they get bad answers from moronzilla. we regulars do have to keep
some order here. :)

J> Bottom line, if you're someone who likes perl and wants more perl
J> opportunities for everyone... be nice to people.

i try until they exasperate me.

J> BTW, uri, I heard you on perlcast, good job!

thanx. i was nice there? :)

uri
 
U

Uri Guttman

MD> Remember that amateurs built Noah's Ark.
MD> Professionals built the Titanic.

but $DEITY designed the ark and arrogant humans designed the titanic.

and i don't use the word professional as someone who gets paid. i use it
as someone who chose a profession because they are good at it. amateur
and professional also mean the attitude you have about your work. you
can say a paid piece of work looks amateurish or a free piece looks
professional.

uri
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top