From: Lars Eighner on
I'm still looking for a function-type database interface. CPAN returns more
than 1100 hits for mysql, but if there is a function interface, I haven't
found it.

--
Lars Eighner <http://larseighner.com/> Warbama's Afghaninam day: 98
2357.9 hours since Warbama declared Viet Nam II.
Warbama: An LBJ for the Twenty-First century. No hope. No change.
From: Lars Eighner on
In our last episode,
<vilain-A30EAB.01440910032010(a)news.individual.net>,
the lovely and talented Michael Vilain
broadcast on comp.lang.perl.misc:

> In article <slrnhpeglp.ko8.usenet(a)debranded.larseighner.com>,
> Lars Eighner <usenet(a)larseighner.com> wrote:

>> I'm still looking for a function-type database interface. CPAN returns more
>> than 1100 hits for mysql, but if there is a function interface, I haven't
>> found it.

> There are lots of CPAN entries for database stuff. What have you found?

More than 1100 entries, but a many of the as I have inspected seem to
involve minus greater-than notation. As I said, I am looking for a
function-type database interface.

--
Lars Eighner <http://larseighner.com/> Warbama's Afghaninam day: 98
2362.9 hours since Warbama declared Viet Nam II.
Warbama: An LBJ for the Twenty-First century. No hope. No change.
From: RedGrittyBrick on
Lars Eighner wrote:
> Michael Vilain wrote:
>> Lars Eighner wrote:
>
>>> I'm still looking for a function-type database interface. CPAN returns more
>>> than 1100 hits for mysql, but if there is a function interface, I haven't
>>> found it.
>
>> There are lots of CPAN entries for database stuff. What have you found?
>
> More than 1100 entries, but a many of the as I have inspected seem to
> involve minus greater-than notation. As I said, I am looking for a
> function-type database interface.
>

Ah, you want a *procedural* API rather than an *object-oriented* API.

AFAIK DBI is object oriented and most (all?) Perl DBMS interfaces use DBI.

What difficulties is the OO API causing you?

--
RGB
From: Lars Eighner on
In our last episode, <4b9796dd$0$2538$da0feed9(a)news.zen.co.uk>, the lovely
and talented RedGrittyBrick broadcast on comp.lang.perl.misc:

> Lars Eighner wrote:
>> Michael Vilain wrote:
>>> Lars Eighner wrote:
>>
>>>> I'm still looking for a function-type database interface. CPAN returns more
>>>> than 1100 hits for mysql, but if there is a function interface, I haven't
>>>> found it.
>>
>>> There are lots of CPAN entries for database stuff. What have you found?
>>
>> More than 1100 entries, but a many of the as I have inspected seem to
>> involve minus greater-than notation. As I said, I am looking for a
>> function-type database interface.
>>

> Ah, you want a *procedural* API rather than an *object-oriented* API.

> AFAIK DBI is object oriented and most (all?) Perl DBMS interfaces use DBI.

> What difficulties is the OO API causing you?

I can't read the notation as for example I can with the PHP mysql functions.

Sure, I can copy an example with minus greater-than notation from a tutorial
--- but in an hour, tomorrow, a week later, it's all greek to me. It isn't
remotely perlish, which would be something like:

opendb(MYDBHANDLE," gory details of db connection here");

and so forth.

--
Lars Eighner <http://larseighner.com/> Warbama's Afghaninam day: 98
2364.1 hours since Warbama declared Viet Nam II.
Warbama: An LBJ for the Twenty-First century. No hope. No change.
From: RedGrittyBrick on
On 10/03/2010 13:15, Lars Eighner wrote:
> In our last episode,<4b9796dd$0$2538$da0feed9(a)news.zen.co.uk>, the
> lovely and talented RedGrittyBrick broadcast on comp.lang.perl.misc:
>
>> Lars Eighner wrote:
>>> Michael Vilain wrote:
>>>> Lars Eighner wrote:
>>>
>>>>> I'm still looking for a function-type database interface.
>>>>> CPAN returns more than 1100 hits for mysql, but if there is a
>>>>> function interface, I haven't found it.
>>>
>>>> There are lots of CPAN entries for database stuff. What have
>>>> you found?
>>>
>>> More than 1100 entries, but a many of the as I have inspected
>>> seem to involve minus greater-than notation. As I said, I am
>>> looking for a function-type database interface.
>>>
>
>> Ah, you want a *procedural* API rather than an *object-oriented*
>> API.
>
>> AFAIK DBI is object oriented and most (all?) Perl DBMS interfaces
>> use DBI.
>
>> What difficulties is the OO API causing you?
>
> I can't read the notation as for example I can with the PHP mysql
> functions.

Interestingly, when I Googled this subject, I encountered a note saying
that the latest PHP API for MySQL is OO not procedural. I didn't read it
carefully, but I got the impression that if you upgrade MySQL you'd have
to switch to the OO API.

I'm afraid the world is moving from procedural to OO. I may be wrong but
I suspect module writers nowadays prefer to write OO APIs.


> Sure, I can copy an example with minus greater-than notation from a
> tutorial ---

I recommend you try to think of a->b as an *arrow* notation. The object
has a pointer to a subroutine, you use that pointer to call the
subroutine (sloppy terminology for simplicity).


> but in an hour, tomorrow, a week later, it's all greek
> to me.

I recommend you write yourself a few simple Perl OO toy programs. I
found it a good way to get familiar with Perl OO paradigms. There are
some good tutorials around and it only needs an hour or so if you have
any prior exposure to OO concepts.

perldoc perlboot; # http://perldoc.perl.org/perlboot.html
perldoc perltoot; # http://perldoc.perl.org/perltoot.html


> It isn't remotely perlish,

It isn't Perl4ish but it is Perl5ish IMHO.


> which would be something like:
>
> opendb(MYDBHANDLE," gory details of db connection here");
>
> and so forth.

Maybe you could write a procedural wrapper for the OO API. Fill the
wrapper with copious comments to yourself. You could centralise this
into a procedural module. I've no idea how feasible this is for you (or
anyone indeed), but it's an idea† you could consider.


Sorry not to be of more help.

--
RGB
† Probably a bad one :-)