my $x = "chapter 5"; print "chap 5 ok!" if $x == 5; # Throws Warning: Argument "chapter 5" isn't numeric in numeric eq (==) $x =~ s/\D+//g; # eliminate all non 0-9 characters from string print "chap 5 ok!" if $x == 5; # chapter 5 is ok now! # The string got "fixed" to be completely numeric # Then when Perl made it into binary number to compare against 5, it worked!