[ic] perl, $Db refs, Safe, and Windows

Mike Heins mikeh@minivend.com
Fri, 5 Jan 2001 18:37:02 -0500


Quoting Bill Randle (billr@exgate.tek.com):
> The Problem:
> ------------
> On the first access of a table from a [perl tables="xxx"]
> block, I can read entires from the "xxx" table. On the next access
> from another [perl tables="xxx"] block (in reality, the same block
> accessed via reloading the page with different cgi values), I get the
> infamous error:
> 	Can't call method "open_table" on an undefined value at
> 	    \Minivend\mvend/lib/Vend/Data.pm at line 762.
> 
> The db/table being opened is a Berkeley db database, accessed via DB_File.
> (I have $ENV{MINIVEND_DBFILE} = 1 uncommented in minivend.bat to force
> DB_File.
> 
> I know the db is OK because, as I said, it could read it the first time.
> The perl code is using tag_data() to access the table.
> 

I am guessing that $MVSAFE::Safe is not getting undefined -- I have not
gone through and vetted all of the reset logic for Windows with IC/MV4, 
as I did with MV3.

Remember, any changes to $Config/$Vend::Cfg stick on Windows; and there
also are many other places where a $Vend::foo variable gets set and
doesn't get reset properly.

To get IC running well on Windows, we would have to identify all of the
transitory $Vend:: variables and set them in a symbol area which could
get reset(), or use $Instance->{foo} instead of $Vend::foo. I have been
jealous of the extra microseconds for the hash lookup, which is why I didn't
do that with MV4 as I had initially planned to.

Many of the inconsistencies in IC/MV have to do with my zeal for performance.
Lots of things can be made more portable by sacrificing performance, which
is an age-old story. 8-(

-- 
Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <heins@akopia.com>

I have a cop friend who thinks he ought be able to give a new ticket;
"too dumb for conditions".