Tim Bunce wrote:
> 
> On Fri, Oct 24, 2003 at 11:00:55AM +0200, Steffen Goeldner wrote:
> > Is there any value in returning a value (pun intended)
> > from STORE? E.g.:
> >
> >   sub STORE  {
> >     ...
> >     return 1;
> >
> > For dbd_db_STORE_attrib(), DBI::DBD states:
> >
> >   The return value is TRUE if you have handled the
> >   attribute or FALSE otherwise.
> 
> That's needed so the Driver.xst code knows if it should
> then call SUPER::STORE.
> 
> > Does the same rule apply to STORE()? If so, where
> > is the returned value used?
> 
> The only way for an application to get the return value is by calling
> STORE explicitly. I guess that might be useful in some situations.

Three cases cross my mind:

 1) Return nothing (or an arbitrary value), i.e. the caller shouldn't
    use that value.

 2) Return a boolean value, indicating success or failure.

 3) Return the new value.

Tim, can you settle on one of these cases? If so, I'd like
to include your recommendation into DBI::DBD.

BTW: Case 1, something like that:

  sub STORE  {
    ...
    $dbh->SUPER::STORE($attr, $val);
    return;
  }

seems to collide with current practice:

  sub begin_work {
    ...
    $dbh->STORE('BegunWork',  1);
  }

  $rc  = $dbh->begin_work   or die $dbh->errstr;


Steffen


P.S.: Funny, a similar question entered the p5p mailing-list

  <http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-10/msg01249.html>

Reply via email to