perl -ne'if(m/if\s*\(.+?=[^~].+?\)/){print "Possible use of = instead of == in line $.\n"}' script.pl #### something() if $var1 = $var2;