Bug 26922: Regression tests
[koha.git] / Koha / MoreUtils.pm
blob02751111ff5c63934334ce1ed9f123f002eb7fc4
1 package Koha::MoreUtils;
3 use Modern::Perl;
5 # From List::MoreUtils v4.0
6 sub singleton {
7 my %seen = ();
8 my $k;
9 my $seen_undef;
10 grep { 1 == ( defined $_ ? $seen{ $k = $_ } : $seen_undef ) }
11 grep { defined $_ ? not $seen{ $k = $_ }++ : not $seen_undef++ } @_;