blob: 020485d66a62eb5ff36d770a80b26eb1ba3b6730 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
my %opt;
while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/)
{
$opt{$1}=$2;
shift(@ARGV);
}
if ($] =~ /\.(\d\d\d)?(\d\d)?$/) { # should always be true
$opt{PATCHLEVEL} = int($1 || 0);
$opt{SUBVERSION} = $2 || '00';
}
while (<>)
{
s/~([\w_]+)~/$opt{$1}/g;
$_ = "$1='$opt{$1}'\n" if (/^([\w_]+)=/ && exists($opt{$1}));
print;
}
|