On Tue, 06 Jan 2009 16:48:47 +0300 Richard Hainsworth
wrote:
RH> Suppose I want a 'when' clause to fire when the test is *not*
RH> met. What syntax should be used?
Maybe the parser can be smart enough to recognize this:
given $x
{
! // {say 'this does not contain a digit'}
}
Other suggest
On Tue, Jan 6, 2009 at 3:48 PM, Richard Hainsworth wrote:
> Suppose I want a 'when' clause to fire when the test is *not* met. What
> syntax should be used?
>
> So how would I do
>
> my $x = 'abced';
> given $x {
> when ! // {say 'this does not contain a digit'} # this does not work
> }
>
> Since
Suppose I want a 'when' clause to fire when the test is *not* met. What
syntax should be used?
So how would I do
my $x = 'abced';
given $x {
when ! // {say 'this does not contain a digit'} # this does
not work
}
Since the ~~ operator is implied in the when, how do we get an implied
!~~ op