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 (/#define\s+ARCHLIBEXP/)
43 print H "#include <win32.h>
44 #define ARCHLIBEXP (win32PerlLibPath())
51 chmod(0666,"../lib/CORE/config.h");
52 copy("$file.new","../lib/CORE/config.h") || die "Cannot copy:$!";
53 chmod(0444,"../lib/CORE/config.h");
55 if (compare("$file.new",$file))
57 warn "$file has changed\n";
60 rename("$file.new",$file);
68 my $val = $Config{$var};
69 $val = 'undef' unless defined $val;
77 if ($cmd =~ /^echo\s+(.*?)\s*\|\s+sed\s+'(.*)'\s*$/)
79 local ($data,$pat) = ($1,$2);
81 eval "\$data =~ $pat";
86 die "Cannot handle \`$cmd\`";