I notice that you do a
SELECT *
ovid's node Death to Select Star! suggests that this may not be a good idea.

You may consider using placeholders btrott explains why you might want to user them

To my ignorant eye, it looks like you have a seperate table for each userID. This feels weird and looks like it might make it hard to do stuff like:

my $sql="HERE_DOC; SELECT p.userID, LEN(p.passwd) FROM password p WHERE LEN(p.passwd)<6 GROUP BY p.userID; HERE_DOC"
....Also to my eye, HERE documents are nicer way to format SQL than a single line of text.

It might be easier to follow if your main function wasn't CheckPass(). It is a bit more conventional to do something like this inside main():

if ( !CheckPass() ){ #bail }else{ # continue }
You might define some global constants and comments at the top of your program so if the name of your database changes, you or your replacement could change the constant without really remembering how your script worked.
use constant SCRIPT_DB => 'script_db' # use constant PASSWORD_TABLE => 'passwd'; #
As others have pointed out, you may wish to enable taint mode by putting a -T as an argument to perl on your #! line (oddly enough perldoc perlrun indicates this will workin in windoze as well

This will make your program choke on this line:

open FILE, $q->param('File')
...because you have not removed all the shell characters and somebody could ask you to open a | pipe to a bad command or two

..Hope this helps. I'm sure a more knowledgeable monk will point out any problems with my problems



email: mandog


In reply to Re: Easy Script Editor by mandog
in thread Easy Script Editor by George_Sherston

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.