NDBM_File file not found?

Discussion in 'Perl' started by Greg G, Aug 18, 2004.

  1. Greg G

    Greg G Guest

    Can someone tell me why the "tie" command here might be failing with a
    file not found? The file refered to by $fname is there, and even
    putting in an absolute path doesn't change the results.

    I'm using ActivePerl 5.8.0 and I got the same results with CPAN 5.8.4 as
    well.

    Thanks.


    #!/usr/local/bin/perl

    use Fcntl;
    use NDBM_File;

    $fname = "20040817";

    %dbinfo = ();

    $db = tie (%dbinfo, 'NDBM_File', $fname, O_RDONLY, 0);
    if (!defined $db) {
    die "Can't open \'$fname\': $! \n";
    }

    while (($key,$val) = each %dbinfo) {
    print $key, ' = ', unpack('L',$val), "\n";
    }

    untie %dbinfo;


    -Greg G
     
    Greg G, Aug 18, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. William Parker
    Replies:
    1
    Views:
    3,133
    Martin
    Jun 27, 2004
  2. Replies:
    3
    Views:
    587
  3. Trent Mick
    Replies:
    0
    Views:
    498
    Trent Mick
    Apr 3, 2008
  4. Jacob Davis
    Replies:
    0
    Views:
    527
    Jacob Davis
    Apr 15, 2008
  5. jodleren
    Replies:
    1
    Views:
    126
    jodleren
    Sep 18, 2008
Loading...

Share This Page