in reply to RE: RE: RE: RE: RE: Re: Silencing the grumbling from DBD::ODBC
in thread Silencing the grumbling from DBD::ODBC
If the method under normal circumstances is returning a false value, and correctly printing its warnings via warn, this is not touched by eval:
We have to trap $SIG{__WARN__} if we want to capture the "some warning" text. Otherwise it's printed straight to STDERR, even if we're in an eval block. Eval doesn't "return" the warning, it returns whatever its code returns (in this case, whatever selectcol_arrayref returns). I think you're mistaken.$a = eval { warn "some warning\n"; }; # "some warning" to STDERR print "a=$a\n"; # 1 ('warn' succeeds) print "@=$@\n"; # <undefined>
|
|---|