+
+ # do a conversion if required
+ if ($convert) {
+ my ($key, $val, $action, $count, $err) = ('','',0,0,0);
+
+ my %oldu;
+ dbg("Converting the User File to V3 ");
+ dbg("This will take a while, I suggest you go and have cup of strong tea");
+ my $odbm = tie (%oldu, 'DB_File', "$fn.v2", O_RDONLY, 0666, $DB_BTREE) or confess "can't open user file: $fn.v2 ($!) [rebuild it from user_asc?]";
+ for ($action = R_FIRST; !$odbm->seq($key, $val, $action); $action = R_NEXT) {
+ my $ref = asc_decode($val);
+ if ($ref) {
+ $ref->put;
+ $count++;
+ } else {
+ $err++
+ }
+ }
+ undef $odbm;
+ untie %oldu;
+ dbg("Conversion completed $count records $err errors");
+ }
+ $filename = $ufn;