3 use File::Compare qw(compare);
4 use File::Copy qw(copy);
6 $name =~ s#^(.*)\.PL$#../$1.SH#;
7 open(SH,"<$name") || die "Cannot open $name:$!";
12 ($term,$file,$pat) = /^sed\s+<<(\S+)\s+>(\S+)\s+(.*)$/;
14 my $str = "sub munge\n{\n";
16 while ($pat =~ s/-e\s+'([^']*)'\s*//)
19 $e =~ s/\\([\(\)])/$1/g;
20 $e =~ s/\\(\d)/\$$1/g;
29 open(H,">$file.new") || die "Cannot open $file.new:$!";
33 s/\$([\w_]+)/Config($1)/eg;
34 s/`([^\`]*)`/BackTick($1)/eg;
38 if (/^\s*#define\s+ARCHLIB_EXP/)
40 $_ = "#define ARCHLIB_EXP (win32PerlLibPath())\t/**/\n";
44 print H "#include <win32.h>
53 chmod(0666,"../lib/CORE/config.h");
54 copy("$file.new","../lib/CORE/config.h") || die "Cannot copy:$!";
55 chmod(0444,"../lib/CORE/config.h");
57 if (compare("$file.new",$file))
59 warn "$file has changed\n";
62 rename("$file.new",$file);
70 my $val = $Config{$var};
71 $val = 'undef' unless defined $val;
79 if ($cmd =~ /^echo\s+(.*?)\s*\|\s+sed\s+'(.*)'\s*$/)
81 local ($data,$pat) = ($1,$2);
83 eval "\$data =~ $pat";
88 die "Cannot handle \`$cmd\`";