in reply to A problem with tie

The file db/ECO may exist, but it is corrupt. I get this error on windows if I first create a file called db/ECO. On Linux, I get a different message:
Uncaught exception from user code: tie said Couldn't open ./db/ECO: Inappropriate ioctl for devic +e
Also, on Linux I can create the file with touch to create an empty file, and that solves the problem. However, on Windows, an empty file isn't good enough - empty files still throw back the same error.

But the error goes away if I properly create the file as a correct DB_File:

C:\temp\t>del db\ECO

C:\temp\t>perl -MDB_File -e "tie(%E,q(DB_File),q(db/ECO))"

C:\temp\t>perl test.pl
no output

So I think that's your problem - this ECO file isn't a valid DB file, and there's something a slight bit off about the way that DB_File sets $! on Windows, such that it gives the wrong error message. (Probably all that confusion about errno vs. bsderrno that goes on with dbm stuff)

-- @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/

Replies are listed 'Best First'.
Re^2: A problem with tie
by hsmyers (Canon) on Mar 06, 2005 at 06:08 UTC
    I willl certainly check on this although I would make a few observations, this is revision 22 in a series for this particular CPAN module. It works fine under 5.6. Do you suppose that some newness in DB_File might be the problem, for instance I can tell you that the files in question were generated by an older version, possibly a much older version. I think having just said that I will revisit the process where by I built the files in the first place, delete and rebuild and then retest---this feels like a likely thing to do just to be safe anyway. Thanks!!

    Update: The problem was in fact a version problem. DB_File of course changes over time as do most things perl. And not to surprisingly it wasn't backwards compatible (typically a race that can't be won anyway) and I was partially stung by that and by how I build new releases. Since changes involve iterative testing I don't bother to re-create the db files after the new versions for the release are created. Silly me! In this case that meant the versions in my dev directory were out of synch with what I actually wanted. Note to self---revise test/build procedures to eliminate dangerous assumptions (redundant for emphasis). Thanks to all!!

    --hsm

    "Never try to teach a pig to sing...it wastes your time and it annoys the pig."