in reply to Re: re-tie the previous db
in thread re-tie the previous db

It is correct, and + is because of the webpage syntax.
$DB_BTREE->{'flags'} = R_DUP ; $x = tie %dictf, "DB_File", "f.db", O_RDWR|O_CREAT, 0666, $DB_BTREE or + die "Cannot open file f.db: $!\n"; my $number = keys %dictf; print "$number\n"; my $number = keys %dictf; print "$number\n"; $key = $value = 0 ; for ($status = $x->seq($key, $value, R_FIRST) ; $status == 0 ; $status = $x->seq($key, $value, R_NEXT) ) { print "$key -> $value\n"; }
However, I made it work with :
$DB_BTREE->{'flags'} = R_DUP ; my $file="f.db"; my $x = tie %h, "DB_File", $file, O_RDWR|O_CREAT, 0666, $DB_BTREE or d +ie "Cannot open file $file: $!\n";

Replies are listed 'Best First'.
Re^3: re-tie the previous db
by Anonymous Monk on Dec 04, 2011 at 09:15 UTC

    It is correct, and + is because of the webpage syntax.

    No, in here, the + isn't red, its part of the code (your copy/paste)

    And, in here, the code is still incomplete.

    $ perl junk Can't locate object method "TIEHASH" via package "DB_File" at junk lin +e 2.

    See on posting complete code.