RE: Blocks in Perl

2004-11-28 Thread Michael Kraus
G'day... > The clearest way is to use a gool 'ole fashioned conditional: > > unless ($sth->execute( 1, $str )) { >($obj->addError("DB write failed"); >return undef; > } Ahh... boc! Thanks! :) > $sth->execute(1, $str) || >do { ($obj->addError("DB write failed"); return undef; } No n

Re: Blocks in Perl

2004-11-28 Thread Randy W. Sims
Michael Kraus wrote: G'day... I know when say reading a file handle or performing a database update that if the function fails you can use one of the or operators to execute an aleternate statement (either or per say or ||). What happens if you want to execute more than one statement? E.g. $sth->ex

Blocks in Perl

2004-11-28 Thread Michael Kraus
G'day... I know when say reading a file handle or performing a database update that if the function fails you can use one of the or operators to execute an aleternate statement (either or per say or ||). What happens if you want to execute more than one statement? E.g. $sth->exectute(1, $str) |