Subject: | enhancement: smart match support |
Date: | Mon, 25 Apr 2016 14:16:59 -0700 |
To: | bug-Iterator-Simple [...] rt.cpan.org |
From: | Slava Litvinov <slava.litvinov [...] gmail.com> |
It would be extremely useful to support smart match operator.
Basically the change is the Iterator/Simple.pm to include
use overload;
use overload '~~' => \&Iterator::Simple::Iterator::contains;
sub contains {
my ( $self, $what ) = @_;
while ( my $item = $self->next() ) {
return 1 if $what ~~ $item;
}
return 0;
}