--- BDB/BDB.xs 2008/03/30 04:34:20 1.31 +++ BDB/BDB.xs 2008/03/30 04:36:51 1.32 @@ -962,7 +962,10 @@ if (*mg->mg_ptr == '!') // should always be the case if (-30999 <= errno && errno <= -30800) { + sv_setnv (sv, (NV)errno); sv_setpv (sv, db_strerror (errno)); + SvNOK_on (sv); /* what a wonderful hack! */ + // ^^^ copied from perl sources return 0; }