The when has an automatically built in smart match ~~. Nice ...but how can I take profit from this smart match if the parameter passed into given can only be a scalar?
Maybe, but you can check that scalar against a variety of things, not all of them scalars.
use 5.010; use strict; use warnings; my @x = qw( abc def ); given ("abc") { when (@x) { print "when\n"; } default { print "default\n"; } }
I have no idea what you are asking.
In reply to Re: Understanding the benefit of Given/When ...
by ikegami
in thread Understanding the benefit of Given/When ...
by LanX
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |