$ perl -Mstrict -wE 'my $str = "[]"; say $str == "[]" ? 1 : 0' Argument "[]" isn't numeric in numeric eq (==) at -e line 1. Argument "[]" isn't numeric in numeric eq (==) at -e line 1. 1 #### $ perl -Mstrict -wE 'my $str = "42"; say $str == "[]" ? 1 : 0' Argument "[]" isn't numeric in numeric eq (==) at -e line 1. 0