Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^5: Bring back the smartmatch operator (but with sane semantics this time)!

by moritz (Cardinal)
on Jun 16, 2014 at 19:47 UTC ( #1090069=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Bring back the smartmatch operator (but with sane semantics this time)!
in thread Bring back the smartmatch operator (but with sane semantics this time)!

use 5.014; use strict; use Devel::Peek; my $x = 'not a number'; say 0 + $x; Dump $x; __END__ 0 SV = PVNV(0x1b87050) at 0x1ba83b8 REFCNT = 1 FLAGS = (PADMY,POK,IsCOW,pIOK,pNOK,pPOK) IV = 0 NV = 0 PV = 0x1bafe30 "not a number"\0 CUR = 12 LEN = 14 COW_REFCNT = 1

By your definition, smart-matching against $x would do a numeric comparision, because it has a numeric slot. There's your WTF right away.


Comment on Re^5: Bring back the smartmatch operator (but with sane semantics this time)!
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1090069]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2015-07-03 08:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (49 votes), past polls