in reply to re-tie the previous db

Besides being incomplete, it doesn't compile

syntax error at - line 2, near "+ or" Execution of - aborted due to compilation errors.

How do I post a question effectively?/http://sscce.org/ - Short, Self Contained, Correct Example

Replies are listed 'Best First'.
Re^2: re-tie the previous db
by CountZero (Bishop) on Dec 04, 2011 at 10:11 UTC
    That is probably just sloppy copy / pasting out of an editor which uses "+" as some line continuation mark.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re^2: re-tie the previous db
by Anonymous Monk on Dec 04, 2011 at 09:03 UTC
    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";

      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.