A
Andras Malatinszky
I'm trying to read a database that I created using the DB_File module on
a Linux box and then transferred to a Windows box. Here's a simplified
setup illustration of my problem:
First, on the Linux box I ran this script:
#!/usr/bin/perl -w
use strict;
use DB_File;
tie my %db, 'DB_File', 'database.db';
$db{'blue'}='azul';
untie %db;
As expected, it creates a file called database.db, and when I run this
script:
#!/usr/bin/perl -w
use strict;
use DB_File;
tie my %db, 'DB_File', 'database.db' or die $!;
print $db{'blue'};
untie %db;
I get the word "azul" printed on the screen as expected.
So now I FTP database.db and the second script over to my Windows box
and run the script. What I get is an error message saying "Died at
read.pl line 5." (Line 5 being the one with the tie.)
Why is this happening? Why am I not getting anything in the $! variable?
Does DB_File work with different formats on Linux and Windows? Any
suggestions for addressing this, short of dumping the database on the
Linux box and rebuilding it on the Windows box?
Thanks,
Andras
a Linux box and then transferred to a Windows box. Here's a simplified
setup illustration of my problem:
First, on the Linux box I ran this script:
#!/usr/bin/perl -w
use strict;
use DB_File;
tie my %db, 'DB_File', 'database.db';
$db{'blue'}='azul';
untie %db;
As expected, it creates a file called database.db, and when I run this
script:
#!/usr/bin/perl -w
use strict;
use DB_File;
tie my %db, 'DB_File', 'database.db' or die $!;
print $db{'blue'};
untie %db;
I get the word "azul" printed on the screen as expected.
So now I FTP database.db and the second script over to my Windows box
and run the script. What I get is an error message saying "Died at
read.pl line 5." (Line 5 being the one with the tie.)
Why is this happening? Why am I not getting anything in the $! variable?
Does DB_File work with different formats on Linux and Windows? Any
suggestions for addressing this, short of dumping the database on the
Linux box and rebuilding it on the Windows box?
Thanks,
Andras