File: Filter.pm

package info (click to toggle)
libextutils-builder-perl 0.017-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 276 kB
  • sloc: perl: 1,351; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 487 bytes parent folder | download
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
package ExtUtils::Builder::FileSet::Filter;
$ExtUtils::Builder::FileSet::Filter::VERSION = '0.017';
use strict;
use warnings;

use base 'ExtUtils::Builder::FileSet';

use Carp ();

sub new {
	my ($class, %args) = @_;
	my $self = $class->SUPER::new(%args);
	$self->{condition} = $args{condition} or Carp::croak('No condition given');
	return $self;
}

sub add_input {
	my ($self, $source) = @_;

	if ($self->{condition}->($source)) {
		$self->_pass_on($source);
	}
	return $source;
}

1;