Murat Ünalan wrote:
print "creditcard" if $var ~~ CreditCard( 'VISA' );Brought to a point: Properties could be also smart matched.
Properties *can* be smart-matched: print "creditcard" if $var.prop().{CreditCard} ~~ 'VISA'; or: print "creditcard" if $var.prop{CreditCard} ~~ 'VISA'; or: print "creditcard" if $var.CreditCard ~~ 'VISA'; Damian