$inp2 !~ /^file=\w+$/i
Compare with file=ccmsg.2 -- the dot does not match \w.
In reply to Re: Checking Wrong Condition by moritz in thread Checking Wrong Condition by Divakar