LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 02-18-2005, 07:39 PM   #1
ginda
Member
 
Registered: Mar 2004
Distribution: SUSE8.2, 9.2, Knoppix
Posts: 323

Rep: Reputation: 31
Apache & Perl problem


Hello

Ive started learning perl development with dbi to mysql. I have managed to read from tables etc. i have now started reading abit on cgi on apache, and made a little script based on one i made before reading form the mysql. It just does not work, can anyone please help



The error i get is:


Global symbol "$string1" requires explicit package name at c:\PROGRA~1\APACHE~1\apache\cgi-bin\test.cgi line 12.
Global symbol "$sth" requires explicit package name at c:\PROGRA~1\APACHE~1\apache\cgi-bin\test.cgi line 13.
Global symbol "$dbh" requires explicit package name at c:\PROGRA~1\APACHE~1\apache\cgi-bin\test.cgi line 13.
Global symbol "$string1" requires explicit package name at c:\PROGRA~1\APACHE~1\apache\cgi-bin\test.cgi line 13.
Global symbol "$sth" requires explicit package name at c:\PROGRA~1\APACHE~1\apache\cgi-bin\test.cgi line 14.
Global symbol "$string1" requires explicit package name at c:\PROGRA~1\APACHE~1\apache\cgi-bin\test.cgi line 20.
Execution of c:\PROGRA~1\APACHE~1\apache\cgi-bin\test.cgi aborted due to compilation errors.





And my script is:



#!c:/perl/bin/perl

use DBI;
$dbh = DBI->connect('dbi:mysql:exelstock');
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;

my $string;

#prepare and execute SQL statement
$string1 = "Show tables";
$sth = $dbh->prepare($string1);
$sth->execute ||
die "Could not execute SQL statement ... maybe invalid?";

print header;
print start_html("Thank You");
print h2("Thank You");
print $string1;

my %form;
foreach my $p (param()) {
$form{$p} = param($p);
print "$p = $form{$p}<br>\n";
}
print end_html;





I basically want a web front end to a mysql database table...

Last edited by ginda; 02-18-2005 at 07:40 PM.
 
Old 02-18-2005, 07:44 PM   #2
lukeleia3
LQ Newbie
 
Registered: Dec 2004
Distribution: Mandrake 9.0 Dolphin Release 2.4.19-16mdk
Posts: 24

Rep: Reputation: 15
whats with the c;/ drive sounds like ms window problems
 
Old 02-18-2005, 07:49 PM   #3
ginda
Member
 
Registered: Mar 2004
Distribution: SUSE8.2, 9.2, Knoppix
Posts: 323

Original Poster
Rep: Reputation: 31
Im doing this develpment as part of my university group, the laptop we use, is windows im afraid. It has activeperl, my sql, apache all installed and scripts run all ok, just when i try to access a mysql table using DBI it doesnt work, i am very new to perl, dbi, cgi
 
Old 02-18-2005, 07:56 PM   #4
nikki
LQ Newbie
 
Registered: Feb 2005
Distribution: Mandrake 10.0/FreeBSD 4.10 & 5.3
Posts: 10

Rep: Reputation: 0
Quote:
Originally posted by lukeleia3
whats with the c;/ drive sounds like ms window problems
rofl... should they be looking in /usr/bin/perl, lukeleia3? you are so bad :P

Quote:
#!c:/perl/bin/perl
doesn't windoze use a backwards slash? maybe this is your problem in the first line.

Last edited by nikki; 02-18-2005 at 08:01 PM.
 
Old 02-18-2005, 07:59 PM   #5
lukeleia3
LQ Newbie
 
Registered: Dec 2004
Distribution: Mandrake 9.0 Dolphin Release 2.4.19-16mdk
Posts: 24

Rep: Reputation: 15
when i use appache i usually grab the 6 inch thick manual "Apache Server Unleased" I also have the "Samba Unleashed" I do how ever have the pdf "Apache Server Unleased" if you want and have a big enough email box i could send it to you.

possible solution is " what the heck happened to ms windows? How did linux get installed on here?"

I dont know how it is installed on ms winders i use linux and nikki your correct on linux

Last edited by lukeleia3; 02-18-2005 at 08:02 PM.
 
Old 02-18-2005, 08:04 PM   #6
ginda
Member
 
Registered: Mar 2004
Distribution: SUSE8.2, 9.2, Knoppix
Posts: 323

Original Poster
Rep: Reputation: 31
hahaha trust me ive been planning to install suse on there just thinking of a good enuff excuse

can you mail it to jinda@go.com my trash, crap, bucket of email
 
Old 02-18-2005, 08:04 PM   #7
nikki
LQ Newbie
 
Registered: Feb 2005
Distribution: Mandrake 10.0/FreeBSD 4.10 & 5.3
Posts: 10

Rep: Reputation: 0
Id like to have that apache server unleased on pdf and my mailbox should be plenty big enough
 
Old 02-18-2005, 08:11 PM   #8
nikki
LQ Newbie
 
Registered: Feb 2005
Distribution: Mandrake 10.0/FreeBSD 4.10 & 5.3
Posts: 10

Rep: Reputation: 0
so did correcting the slashes in the path to perl fix it?
 
Old 02-18-2005, 08:45 PM   #9
ginda
Member
 
Registered: Mar 2004
Distribution: SUSE8.2, 9.2, Knoppix
Posts: 323

Original Poster
Rep: Reputation: 31
Nope....perl still works with either slashes.....
 
  


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
Problem with perl module for w3c validator to work on my local Apache+PHP+perl instal tbamt Linux - Software 0 12-16-2004 06:37 PM
Apache 1.3.29 with mod perl & php built in upgrade jester_69 Linux - General 0 02-22-2004 01:26 AM
Compiling Apache, MySQL, Perl & PHP jeucken Linux - Software 1 12-15-2003 02:56 PM
Apache Web Server w/PHP & Perl Mark Grinstead Linux - Software 2 07-18-2003 08:23 AM
perl & apache problem tanmaya Linux - Software 0 04-07-2003 04:13 AM


All times are GMT -5. The time now is 10:21 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration