$ 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