Well those sound to me like warnings (do you have use warnings or a -w on your #! line?) The reason you are getting them doesn't seem to be immediatly clear. Its possible that you queries are doing because you have the variables interpolated in the string of your query.

A much better way to do that is to use placeholders. Placeholders keep your code cleaner and easier to maintain and it also allows the DBI module to filter out dangerous characters from variables passed to the program. You create a placeholder by using a ? instead of the variable name and then putting the variable in your execute statement. Part of your code would look like this:

if ($parent eq "Father") { $sub_parent = "Mother"; $sth = $dbh->prepare ("select Father from Roster where User = +?); $sth->execute($user) or die $sth->errstr; # putting 'or die $sth->errstr;' will tell you if # your query fails and why $name = $sth->fetchrow_array; } #end if Father

That may or may not take care of the warnings. But even if it doesn't its a good practice.

Hope that helps
Chris


In reply to Re: uninitialized value in concatenation by cfreak
in thread uninitialized value in concatenation by mnlight

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.