in reply to perl if statement

From your other posts in this thread, especially this one, I get the feeling that you are searching the file for the literal string "username|pin" - is that correct? Because if so, your pattern is not correct, as it will match any line that contains either the username or the pin due to the alternation |. You should probably be using the pattern /^\Q$FORM{user}|$FORM{pin}\E$/ instead (see quotemeta for what \Q...\E does). Otherwise, you've built yourself a huge security hole if someone sets their password to, for example "."!

Could you show us an example of what your input file actually looks like?

Replies are listed 'Best First'.
Re^2: perl if statement
by Drsin (Novice) on Mar 02, 2016 at 14:52 UTC
    Hi.. the text file looks:
    SAPPE 5681 ANNE 8152 AUDIT 8302 AUDIT1 5201 AUDIT3 1124
      Thank you all. I sorted the issue. It was my text file format. Now I made it:
      SAPPE|5681 ANNE|8152 AUDIT|8302 AUDIT1|5201 AUDIT3|1124