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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-25-2006, 02:36 PM
|
#1
|
Member
Registered: Sep 2005
Posts: 33
Rep:
|
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 
|
|
|
04-26-2006, 06:15 AM
|
#2
|
Member
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430
Rep:
|
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
|
|
|
04-26-2006, 06:59 AM
|
#3
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,516
|
blank?
completely?
what happens when you do it in offline mode?
e.g: blah.cgi x=y
|
|
|
04-26-2006, 09:36 AM
|
#4
|
Member
Registered: Sep 2005
Posts: 33
Original Poster
Rep:
|
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
|
|
|
04-26-2006, 11:06 AM
|
#5
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,516
|
maybe, different if created on a different machine.
have you tried:
use AnyDBM_File;
|
|
|
04-27-2006, 01:14 PM
|
#6
|
Member
Registered: Sep 2005
Posts: 33
Original Poster
Rep:
|
Quote:
Originally Posted by bigearsbilly
maybe, different if created on a different machine.
have you tried:
use AnyDBM_File;
|
Tried that, no luck 
|
|
|
04-28-2006, 04:11 AM
|
#7
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,516
|
does it work on localhost?
can you see the server logs?
|
|
|
All times are GMT -5. The time now is 11:49 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|