smart matching

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I was doing an odd exercise that asks to perform some task by only using
"smart matching".
But then the solution uses
   when (! /\A\d+\Z/) ...
Isn't that dumb matching?
I would use
   when (0 ~~ ($_ ~~ /\A\d+\Z/)) ...

The solution also uses
   my @empty;
   when (@list ~~ @empty) ...
saying that we could just use @list in scalar context, but we have to
use smart matching.
What about
   when (0 ~~ !!@list) ...


Site Timeline