Perl will try to convert the scalar to the type required by the context in which it is used.
There is a valid conversion from any scalar type to a string, so this is always done silently.
Converting to a number is also performed silently if the string passes the test looks_like_number(available through Scalar::Util). Otherwise, a warning is issued, and in any case, the “best guess” approximation is performed.
my $string = '9';
if ( $string == 9 ) { print "YES" };
9, YES .
my $string = '9,8';
if ( $string == 9 ) { print "YES" };
Argument "9,8" isn't numeric in numeric eq (==), 9, YES .
, , , 5.0.