Bug 19069: Fix 'does not match' behaviour in MARC modification template
[koha-equinox.git] / Koha / MoreUtils.pm
1 package Koha::MoreUtils;
2
3 use Modern::Perl;
4
5 # From  List::MoreUtils v4.0
6 sub singleton (@)
7 {
8     my %seen = ();
9     my $k;
10     my $seen_undef;
11     grep { 1 == ( defined $_ ? $seen{ $k = $_ } : $seen_undef ) }
12       grep { defined $_ ? not $seen{ $k = $_ }++ : not $seen_undef++ } @_;
13 }
14
15 1;