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