LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-25-2006, 03:36 PM   #1
server-solution
Member
 
Registered: Sep 2005
Posts: 33

Rep: Reputation: 15
Question Perl database blank


Hi all

I was using hostforweb.com to host a website, I have now moved it to my home server.

I was using perl cgi as a database to hold names and links

the code for the cgi is

#!/usr/bin/perl -w
use CGI qw(:all);

print header;



dbmopen(%h, "linksdata", 0644) || die "Cannot open: $!";
foreach ( sort keys %h ) {
print ' <font color="#0000FF" size="5">', "$_", '</font> <br> <table width="600" border="0">', "$h{$_}\n", '</table>';
print "<br><br>";
}
dbmclose(%h);

the cgi runs, however the output is blank???? The .dir .pag files are there, it just doesn't show anything in the database?

Server version: Apache/2.0.55
This is perl, v5.8.5 built for i586-linux

Thanks in advance
 
Old 04-26-2006, 07:15 AM   #2
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
Check if you are referring to the proper dir and pag file or the script is running in some location and creating a empty database.

Also try to print %h as such and see if any result is printed.

Check the permission of the database files [whether they have proper ownership and file permission]

Cheers
Zulfi
 
Old 04-26-2006, 07:59 AM   #3
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
blank?
completely?
what happens when you do it in offline mode?

e.g: blah.cgi x=y
 
Old 04-26-2006, 10:36 AM   #4
server-solution
Member
 
Registered: Sep 2005
Posts: 33

Original Poster
Rep: Reputation: 15
ok, both files are there and have size of 18k, which sounds right for the amount o information.

Permissions are fine and I have tried command line, still no luck, the cgi prints the html header and doesn't error to say it had a problem opening the database.

I was thinking, could it be a problem with the perl version? maybe different versions access perl databases differently? or could moving the file via ftp have corrupted it? below are the file types

linksdata.dir: GNU dbm 1.x or ndbm database, little endian
linksdata.pag: GNU dbm 1.x or ndbm database, little endian
 
Old 04-26-2006, 12:06 PM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
maybe, different if created on a different machine.
have you tried:

use AnyDBM_File;
 
Old 04-27-2006, 02:14 PM   #6
server-solution
Member
 
Registered: Sep 2005
Posts: 33

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bigearsbilly
maybe, different if created on a different machine.
have you tried:

use AnyDBM_File;

Tried that, no luck
 
Old 04-28-2006, 05:11 AM   #7
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
does it work on localhost?
can you see the server logs?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with database perl silhoutte Linux - Newbie 4 05-24-2005 12:12 AM
Import Database Function Script Using Perl?? domquem Programming 3 01-13-2005 10:05 AM
How to interact with MYSQL database from within perl program Bassam Programming 5 02-26-2004 06:00 PM
Blank entries inserted into mysql database sandoz Programming 4 09-22-2003 04:51 AM
Perl and Database formats. CragStar Programming 6 08-11-2002 04:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration