From the Smart matching in detail section in perlsyn:
The smart match operator
short-circuits whenever possible.
Does ~~ have anything in common with short circuit operators (&&, ||, etc.) ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The meaning of short-circuiting here is that evaluation will stop as soon as the boolean outcome is established.
For the input
b, Perl won’t look at the elements followingbin@x. Thegrepbuilt-in, on the other hand, to which the document you quote makes reference, will process the entire list even though all that’s needed might be a boolean.