$_ = '0$'; if($_ =~ "^0\$") { print "find\n"; } else { print "not find\n"; } result is: not find