use 5.010; use strict; use warnings; my @a=qw(abc def); given (@a) { when (/abc/ ) { say '/abc/'; continue; } when (qr/abc/) { say 'qr/abc/'; continue; } } say '--'; if (@a ~~ /abc/ ) { say '/abc/'; } if (@a ~~ qr/abc/) { say 'qr/abc/'; }
The discrepency is odd, though.qr/abc/ -- /abc/ qr/abc/
In reply to Re^5: Smart enough for Smart Match??? (was "Understanding ...Given/When" )
by ikegami
in thread Understanding the benefit of Given/When ...
by LanX
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |