in reply to Re: perl grep help!
in thread perl grep help!

hi with the 'let the database work for you' example....how would I get it so users define the username and password as its meant to be a login type script? also im ignoring the login issues i.e. access to passwords till the end. Thanks for your help so far! bogglemaster89

Replies are listed 'Best First'.
Re^3: perl grep help!
by chromatic (Archbishop) on Mar 09, 2010 at 17:42 UTC
    How would I get it so users define the username and password as its meant to be a login type script?

    You ask for user input, whether reading from the STDIN, taking command-line arguments, or reading a file with login credentials.

      i added:
      print "please enter a username /n"; my $usernameentered = <STDIN>; print "please enter a password /n"; my $passwordentered = <STDIN>;
      to the top of the script i also changed the ? to a real username and password it failed with the following.... DBD::mysql::st execute failed: called with 2 bind variables login.pl line 16. SQL Error: called with 2 bind variables when 0 are needed im guessing this maybe becasue this is where my <STDIN> where meant to go? sorry to keep bombarding you with questions but im really stuck! bogglemaster89 UPDATE- I replaced what I typed with question marks, it runs now, but im not sure what to do to get it to match these passwords and if they dont match through an error.......to the end-user of course not me!

        Read chomp and read the DBI documentation on placeholders. Given that you had to be told not to pull back all of the rows of a table and compare the values of each row, I suggest you learn some basic SQL also. There are many good resources online. You don't seem to be taking the advice you're given in reply to your various questions.

Re^3: perl grep help!
by jrsimmon (Hermit) on Mar 09, 2010 at 18:02 UTC
    You'll have to request their input, presumably via STDIN. You'll also want to look at Term::ReadKey so that their passwords aren't printed to the screen when typed.