To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
The technical storage or access that is used exclusively for statistical purposes.
The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Hi,
First: thanks for sharing!
Second: I’m very happy to see notices I didn’t know, like the HTTP::Tiny in core, etc too many time without read delta or brew new versions…
Greetings!
Slide 24 of 61 Smart Match Examples
In Perl 5.10.0
perl -le ‘@a=(1,2,3); print “found\n” if @a ~~ 2;’
found
perl -le ‘@a=(1,2,3); print “found\n” if 2 ~~ @a;’
found
In Perl 5.10.1 and above:
perl -le ‘@a=(1,2,3); print “found\n” if @a ~~ 2;’
perl -le ‘@a=(1,2,3); print “found\n” if 2 ~~ @a;’
found
You example uses @foo ~~ bar which does not work since 5.10.0. To find scalar in array the array has to be the second.
You’re absolutely right, of course. In my defence, that slide is in the 5.10 section, so the code does work.
But I should reverse the order of the operands in all of those examples.
Thanks.