perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kee Hinckley <naz...@somewhere.com>
Subject Re: DBIx:Recordset q's
Date Sun, 16 Mar 2003 19:17:27 GMT
At 12:57 PM +0100 3/16/03, Kaare Rasmussen wrote:
>Hi
>
>I'm in doubt if DBIx::Recordset is what I need. It has a lot going for it, for
>one thing it works well with Embperl :-) But I do have some doubt.
>
>I thought I could do something like this:
>
>     $set = DBIx::Recordset -> SetupObject ({
>       '!DataSource'   => $db
>     });
>     $set -> Begin;
>     ...
>     $set -> Update ({%values,
>      ('!Table' => 'ar_journal',
>       '!Fields' => \%values,
>        '\paid'  => "paid + $paid",
>       '!PrimKey' => 'ar_id'
>      )}
>     $set -> Commit;
>     DBIx::Recordset::Undef ('set');
>
>i.e. use DBIx::Recordset to hide the uglyness of DBI. Insted I find that I
>have to let it glob into my module's vars. Am I using it wrong, or do I
>expect something that it was not intended to do?

You don't have to use DBIx::Recordset with globs.  I always use 
scalars.  You just need to change the syntax a little

$set->function)_ becomes $$set->function()

And I think you'd call $$set->Undef() as well (or pass $set to Undef).

-- 
Kee Hinckley
http://www.puremessaging.com/        Junk-Free Email Filtering
http://commons.somewhere.com/buzz/   Writings on Technology and Society

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message