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. Advertisements

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,282
    Martin
    Jun 27, 2004
  2. Replies:
    4
    Views:
    44,485
    spatil02
    Jan 30, 2012
  3. Replies:
    3
    Views:
    779
  4. manish pendse

    File or assembly name <some temp file> not found..

    manish pendse, Aug 21, 2005, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    356
    Bennie Haelen
    Aug 23, 2005
  5. Help Needed
    Replies:
    1
    Views:
    443
    Jason M. Murray
    Sep 19, 2003
  6. Eric
    Replies:
    10
    Views:
    714
  7. Eric
    Replies:
    0
    Views:
    400
  8. jodleren
    Replies:
    1
    Views:
    195
    jodleren
    Sep 18, 2008
Loading...