File: Subst.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-- 493 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::Subst;
$ExtUtils::Builder::FileSet::Subst::VERSION = '0.017';
use strict;
use warnings;

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

use Carp ();
use Scalar::Util ();

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

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

	my $target = $self->{subst}->($source);
	$self->_pass_on($target);
	return $target;
}

1;