>perl -Mdiagnostics -e"my $x; if ($x = 2) {}" Found = in conditional, should be == at -e line 1 (#1) (W syntax) You said if ($foo = 123) when you meant if ($foo == 123) (or something like that).