Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I was hoping you would be able to help me understand the following error handling code
I believe that dbh->do will retrun undef if there is an error, but what is the result of assiging an undef to a varible? I guess it must be false otherwise the or test would be passed and the die statement wouldn't happen? I thought an assignment was always true many thanksmy $rows_deleted = $dbh->do(q{ DELETE FROM table WHERE status = ? }, undef, 'DONE') or die $dbh->errstr;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: understanding this database error code handling
by Corion (Patriarch) on Dec 10, 2010 at 22:52 UTC | |
|
Re: understanding this database error code handling
by 7stud (Deacon) on Dec 11, 2010 at 00:46 UTC | |
by ww (Archbishop) on Dec 11, 2010 at 14:23 UTC | |
|
Re: understanding this database error code handling
by wagnerc (Sexton) on Dec 11, 2010 at 00:38 UTC |