On 24 Aug 2011, at 18:15, Bill Luebkert wrote:

> On 8/24/2011 9:08 AM, Eric Robertson wrote:
>> I have a problem with DB_File and Perl 5.12. I posted a message on the ASPN 
>> message board but no one there has come back with an
>> answer so I’m trying here.
>> 
>> I have some Perl CGI scripts which were developed some time ago using 
>> ActivePerl 5.8. When my Mac OS started using 5.10 I considered
>> upgrading my version of ActivePerl to 5.10 but I couldn't find a couple of 
>> modules I needed - DBD::CSV and DBD::mysql - so I decided
>> to continue to use 5.8. These scripts produce BerkeleyDB files using DB_File 
>> and I found that when I was remotely debugging these
>> scripts on my virtual host on the Mac these files could be read OK although 
>> the Mac was using the inbuilt 5.10 because the scripts
>> contained the normal /usr/bin/perl shebang line.
>> 
>> I've recently upgraded the Mac's OS to Lion and I see that the inbuilt Perl 
>> version has been changed to 5.12. I now find that I get
>> an error when I try to read the BerkeleyDB files. I've used the followed 
>> code to test the situation and found that 5.12 won't access
>> files produced by ActivePerl 5.8 and vice versa - the error message is 
>> "Can't open test.dbm: Inappropriate file type or format".
>> 
> ...
>> 
>> Is the problem something to do with the BerkeleyDB code rather than Perl and 
>> how can I correct this? I  know I could change the
>> shebang line in my code when testing on my server but I'd have to remember 
>> to change this before I uploaded the code to the live
>> server - which I'm likely to forget!
> 
> I don't know the exact answer to your problem, but a while back I had a
> similar problem and I ended up writing a script that converted the DB
> to a flat file (using the old DB module) and then I wrote a script that
> converted the flat file back to a DB using the new modules (I believe I
> ran the first part at home and then uploaded the flat files to my website
> and then ran the conversion to the new DB there).  It's at least a
> workaround.

Thanks for that workaround. The only copy of my scripts and files are in my 
virtual host. I'd need a script running locally under 5.8 that read the 
DB files and dumped them using, say, Storable and then another script running 
under 5.12 that read the dumps and produced 5.12 compatible 
DB files. 

These DB files would work OK when I was debugging them from my virtual host as 
the shebang would ensure that 5.12 was being used but if I was 
trying to test them locally from Komodo I'd have to change my default setting 
for Perl to the 5.12 location. That's certainly a possibility. 

It would be grand if there's a way in Komodo to determine which version of Perl 
to use on a script by script basis.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to