Thanks. That's cleared now.

I'm also trying to connect to an mssql db from a cgi, and I'm getting the
following error:

Cannot connect: [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does
not exist or access denied. (SQL-08001)[Microsoft][ODBC SQL Server
Driver][DBNETLIB]ConnectionOpen (Connect()). (SQL-01000)(DBD:
db_login/SQLConnect err=-1)Aborting at C:\Savant\cgi-bin\connect_rodopi.cgi
line ...

Help appreciated.

Kind regards

Dayo



-----Original Message-----
From: David Dorward,,, [mailto:[EMAIL PROTECTED] On Behalf Of David Dorward
Sent: Tuesday, November 01, 2005 4:40 PM
To: beginners-cgi@perl.org
Subject: Re: uninitialized variable

On Tue, Nov 01, 2005 at 04:34:45PM +0100, Adedayo Adeyeye wrote:

> I'm getting an error when trying to run a script. Part of the scripts is

> my $action = param('form_action');
> if($action eq 'search');

> The error I get is:
> Use of uninitialized value in string eq at connect_rodopi.cgi line 14. 

Looks more like a warning then an error to me.

> How am I supposed to initialize this value?

By assigning something to it, but in this case its possibly better to
test if something was assigned to it.

if (defined $action && $action eq 'search') ...

or 

if (!defined $action) {
  ...
} elsif ($action eq 'search') {
  ...
} 

-- 
David Dorward                                      http://dorward.me.uk


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to