Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
If the lines in your password file really look like
eoin pass test 1234 admin sys
then
my ($ur,$ps) = split(/\t/, $_, 2);
isn't what you want to do. Assuming that you really do have tabs in the file (and not spaces), the third argument causes you to be left with
(For an explanation of why this is, consult the description of "split" in perlfunc.) Drop the third argument, and you'll be O.K. Stylistic comment: Consider returning a boolean (i.e., 0 or 1) instead of "Valid"/"notValid". There's far less chance of subtle typos causing you hours of debugging grief.
In reply to Re: Login Please!!
by dws
|
|