Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why is my module failing for no reason?

Status
Not open for further replies.

1DMF

Programmer
Joined
Jan 18, 2005
Messages
8,795
Location
GB
I have a module failing, which was working 10 minutes ago but now errors with ...
Undefined subroutine &Memglobs::updSQL called at /cgi-bin/Memglobs.pm line 253.

it is defined and was working fine, whats happend?

my code is as follows....
Code:
######################
# Set Error Trapping #
######################

use CGI::Carp qw(fatalsToBrowser warningsToBrowser); 
use warnings;
use strict;

##########################
# Use WIN32::ODBC Module #
##########################
use Win32::ODBC;

##########################
# Set Package Name Space #
##########################
package sql;

################
# Start Module #
################

BEGIN {

	# Invoke Exporter
	use Exporter;

	# Set Variables
	our (@ISA, @EXPORT);
	@ISA = qw(Exporter);

	# Define global vars and subs to be exported
	@EXPORT = qw( &getSQL &insSQL &updSQL &delSQL &cntSQL $DSN);

}

##################################################
############## Update SQL Routine ################
##################################################

sub updSQL {

#_0 = Table
#_1 = Values
#_2 = Where

# Set Variables
my ($rowcount);

#Build SQL Statement
my $sel = "UPDATE $_[0] SET $_[1] WHERE $_[2]";

# Open DB Connection
my $db = new Win32::ODBC("FILEDSN=$DSN;") || die "updSQL Error Connecting: " . Win32::ODBC::Error();

# Run SQL Command
if(! $db->Sql("$sel") ) {
	# Set rows updated count 
	$rowcount = $db->RowCount(); 

	#Close DB Connection
	$db->Close(); 
} 
else{die "Error in updSQL ($sel)" . Win32::ODBC::Error();}

# Return number of rows updated
$rowcount;

}
###########################
# END OF MODULE RETURN 1; #
###########################
1;

and in Memglobs....
Code:
##################
# Use SQL Module #
##################

use Sql;

so whats the problem ?????

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
ok worked it out, but this is bizzare, I DID NOT change the case on the package statement, so what the hell is this SourceEdit program i use as my text editor playing at!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Module names are case-sensitive, so both the package and use lines should both have the same casing.

-------------
Kirsle.net | Kirsle's Programs and Projects
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top