GDBC的问题--求助

GDBC的问题--求助

GDBC的问题--求助
# ls -l /www/cgi-bin/blog1.db
-rwxr-xr-x 1 root root 98429 9月 7 09:06 /www/cgi-bin/blog1.db

[color=red]
# perl ListByPageIndex1.pl
Content-type: text/plain

Couldn't create /www/cgi-bin/blog1.db!
[/color]
但同样此段程序在另一台服务器上可以执行。
代码如下:
#!/usr/bin/perl

use GDBM_File;
use Fcntl;
use CGI qw/:standard/;

my $idx=param("PageIndex");
my $pageSize=param("PageSize");

print "Content-type: text/plain\n\n";
if($idx <1) {
$idx = 1;
}

if($pageSize <1){
$pageSize = 10;
}

$dbmmap='/www/cgi-bin/blog1.db';


tie (%DB, 'GDBM_File', $dbmmap, O_RD, 0666) or die "Couldn't create $dbmmap!\n";

@keyList = sort(keys(%DB));
my $countList = @keyList;

my $count = ($idx-1) * $pageSize;

my $i;

print "<gdbm>\n";
print " <count>$countList</count>\n";
print " <page idx=\"$idx\" pageSize=\"$pageSize\">\n";

for ($i=0; $i<$pageSize; $i++){
if($count <$countList){
print " <element><key>$keyList[$count]</key><val>$DB{$keyList[$count]}</val></element>\n";
}
$count ++;
}
print " </page>\n";
print "</gdbm>\n";

#foreach $var (sort(keys(%DB))) {
# $val = $DB{$var};
# print "${var}=\"${val}\"\n";
#}

print "$DB{$name}\n";

untie %DB;
检查下,文件夹和文件的权.
检查下,文件夹和文件的权限