logo       

Re: Perl and Mysql display data problem: msg#00018

db.mysql.perl

Subject: Re: Perl and Mysql display data problem

At 3:15 PM -0700 6/24/06, FoRo wrote:
Hello I have several problems. I'm trying to write a perl script that would
check the username and password from Mysql database and allow users to
login. I'm new to both systems and i have a lot of oruble with them. Here is
the perl script that i'm trying to build.

Your problem is not specific to MySQL, but that you used some bad general Perl syntax.

For example, the line that declares "my $uid" is commented out, so you get that undeclared variable warning; you need to have an uncommented "my $uid;".

Also, you should take this line:

my ($input_username = "bobob", $input_password = "password")

And change it to (note also the trailing semicolon):

my ($input_username, $input_password) = ("bobob", "password");

That explains the errors you are getting right now.

Assuming your Perl is version 5.6 or newer (or best, 5.8 or newer), you can also put a "use warnings;" at the top of your script like the "use strict;", which removes the need for any "-w" flag; easier to use in my opinion.

-- Darren Duncan

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:
http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@xxxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise