[RAS] REPEC profile - problem in listing papers already in the database (fwd)
Thomas Krichel
krichel at openlib.org
Fri Sep 3 07:41:06 CDT 2010
Ivan Kurmanov writes
> your checking is correct, but i don't see where (in this case) do you
> get the Storable binary image error from?
From this simple script
| #!/usr/bin/perl
|
| use strict;
| use warnings;
| use BerkeleyDB;
| use Storable qw(thaw nfreeze);
| use Data::Dumper;
|
| ## supply file name
| my $db_file=$ARGV[0];
| if(not $db_file) {
| print "fatal: no file argument\n";
| exit;
| }
| if(not -f $db_file) {
| print "fatal: no such file: $db_file\n";
| exit;
| }
|
| ## supply key
| my $search_key=$ARGV[1];
| if(not $search_key) {
| print "fatal: I need a key\n";
| exit;
| }
|
| ## open db, create if not there
| my $db = new BerkeleyDB::Hash
| -Filename => $db_file;
|
| if(not $db) {
| print "fatal: no such database: $db_file\n";
| exit;
| }
|
| my $value='';
| my $result;
|
| if($result=$db->db_get($search_key,$value)==0) {
| print Dumper thaw $value;
| }
| else {
| print $result;
| }
|
| $db->db_close();
|
| undef $db ;
applied as
aras at nebka:~$ list_value_in_db ~/acis/RI/data/RePEc/records repec:wbk:wbrwps:4511
Storable binary image v68.84 more recent than I am (v2.7) at ../../lib/Storable.pm (autosplit into ../../lib/auto/Storable/thaw.al) line 415, at /home/aras/perl/list_value_in_db line 40
There is no storable image version 68.84.
http://www.perlmonks.org/bare/?node_id=810341
suggests "incompatible byteorder or integer-long-pointer sizes"
as problem sources. Incompatible byte order is the old issue of using
freeze rather than nfreeze. But "integer-long-pointer sizes"
I am not sure about.
Cheers,
Thomas Krichel http://openlib.org/home/krichel
http://authorclaim.org/profile/pkr1
skype: thomaskrichel
More information about the RAS-run
mailing list