Several comments:
- use strict
- use warnings
- avoid wierd changes in capitalization, e.g., $pl = $Plan, $T = $Type
- avoid unnecessary string interpolation, e.g., "$status", "$ss"
- avoid unnecessary temporary variables; what's wrong with using $user?
That said, I believe your problem is that you are assigning $status to $ss, but you haven't removed the line separator from the original string with a healthy chomp. So, $status probably looks like "yes\n", which does not match "yes". The quick fix I think is to say chomp($piece) before splitting $piece.
For a better overall approach, take a step back and look at what you're doing. You've got a single username/password combination that you need to compare to a database entry. To find a match, you're running through the entire list of usernames, and even if you find a match, you continue on through the rest. You can trim some of those useless loop iterations with a last statement. Better still is to load that information into a hashtable, as they are built specifically for looking up information rapidly and efficiently.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.