in reply to perl if statement

if (grep /($FORM{user}|$FORM{pin})/i, "/export/install/users.txt") {

What do you expect grep to do here? grep does not read files, it just processes arrays (even those that contain only one string, like "/export/install/users.txt").

(OK, maybe you want that $FORM{user} or $FORM{pin} contain a regular expression that matches the string "/export/install/users.txt", but I doubt that.)

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^2: perl if statement
by Drsin (Novice) on Feb 29, 2016 at 19:25 UTC
    Hi Alex, I wanted grep to find user|pin in the file users.txt(this is UNIX flat file with list of users and their pin. if YES then it should run the command in system() and if NO it should run command in else.

      Where are you getting $FORM{user} and $FORM{pin} from ?

      poj