NDBM_File file not found?

G

Greg G

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top