-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
gkannan65@yahoo.com (G Kannan) wrote in
news:4a2c62fc.0310101645.5a3763dd@posting.google.c om:
[color=blue]
> Hey all!
>
> I have written a perl script to retrieve information from a HTML Form
> and insert the data into an Oracle database table. I am gettting the
> the following error message:
>
> "Use of uninitialized value in concatenation (.) at register.pl line
> 38, <STDIN> line 10."
>
> The PERL code is as follows:
>
> #!/usr/bin/perl -w
> $| = 1;
> use strict;
> use DBI;
> use CGI qw(:standard);
>
> my $name1 = "";
> my $name2 = "";
> my $strt1 = "";
> my $strt2 = "";
> my $cityname = "";
> my $statename = "";
> my $zipcode = "";
> my $emailadd = "";
> my $useridname = "";
> my $passwd = "";
> my $query = "";
> my $queh = "";
> my $queout = "";
> my $rec = "";
> my $table ="";
> my $query1 = "";
> my $ques = "";
>
> $name1 = param("FirstName");
> $name2 = param("LastName");
> $strt1 = param("StreetAddress1");
> $strt2 = param("StreetAddress2");
> $cityname = param("City");
> $statename = param("State");
> $zipcode = param("Zip");
> $emailadd = param("Email");
> $useridname = param("UserId");
> $passwd = param("Password");
>
> my $dbh =
> DBI->connect('DBI:Oracle:host=172.17.28.199;sid=ORA1', 'f03-cs631r-s02',
> 'architecture') or die "Connection to DB could not be made:",
> $ques->errstr, "\n"; $query = qq[select * from customer_info where
> userid = $useridname]; $queh = $dbh->prepare($query)
> or die "Select statement could not be prepared:", $queh->errstr,
> "\n";
> $queout = $queh->execute()
> or die "Select statement could not be executed: ", $queout->errstr,
> "\n";
> print header();
> if ($queout){[/color]
[snip 450 lines of irrelevant code]
Did you really have to post your whole damn program? Couldn't you just
have posted the code up to line 38 and be done with it? Also, would it
have killed you to point out which line is line 38, instead of making
everyone who might want to help you count the lines by hand?
[color=blue]
> Please advise as to how to rectify this error.[/color]
Here's your warning message (note that it is not an error message):
[color=blue]
> "Use of uninitialized value in concatenation (.) at register.pl line
> 38, <STDIN> line 10."[/color]
Here's line 38, if I've counted correctly:
[color=blue]
> $query = qq[select * from customer_info where userid = $useridname];[/color]
Variable interpolation ($useridname within the qq[] string) is a special
case of concatenation. Clearly, $useridname is undefined.
Here is the only place I can see where $useridname is assigned:
[color=blue]
> $useridname = param("UserId");[/color]
Clearly, param() is returning undef. If you bother to read the CGI
documentation, you'll see that this happens when there is no "UserID"
parameter in the CGI request.
These are simple, obvious steps in diagnosing the problem. None of these
steps is difficult -- even for a rank beginner. If you lack the
initiative to look up error messages in the documentation that came with
your Perl distribution, or to read the CGI documentation, there's not
much I or anyone else can do to help.
It really looks like you just dumped your entire program onto a newsgroup
and cried "help!" at the first sign of any problems. Don't expect
further help unless you can show that you are actually trying to solve
the problem yourself or are trying to learn.
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBP4fwYmPeouIeTNHoEQJdxACfSJ3TBRsnnE/ERfUrvRqayliBZB4AnAx+
who1CTiTa0J7YmTOvqi2VOd3
=Z3tJ
-----END PGP SIGNATURE-----