/usr/share/perl5/Munin/Node/Utils.pm is in munin-node 2.0.25-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | package Munin::Node::Utils;
# $Id$
use strict;
use warnings;
use Exporter ();
our @ISA = qw/Exporter/;
our @EXPORT_OK = qw/
set_difference
set_intersection
/;
### Set operations #############################################################
sub set_difference
{
my ($A, $B) = @_;
my %set;
@set{@$A} = ();
delete @set{@$B};
return sort keys %set;
}
sub set_intersection
{
my ($A, $B) = @_;
my %set;
@set{@$A} = (1) x @$A;
return sort grep $set{$_}, @$B;
}
1;
__END__
=head1 NAME
Munin::Node::Utils - Various utility functions
=head1 SYNOPSIS
use Munin::Node::Utils qw( ... );
=head1 SUBROUTINES
=over
=item B<set_difference(\@a, \@b)>
Returns the list of elements in arrayref \@a that are not in arrayref \@b.
=item B<set_intersection(\@a, \@b)>
Returns the list of elements common to arrayrefs \@a and \@b.
=back
=cut
# vim: ts=4 : et
|