The hoops one has to jump through.
[p5sagit/p5-mst-13.2.git] / x2p / s2p.PL
index 21a5ee8..70aa03d 100644 (file)
@@ -29,8 +29,14 @@ print OUT <<"!GROK!THIS!";
 $Config{startperl}
     eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}'
        if \$running_under_some_shell;
-my \$startperl = "$Config{startperl}";
-my \$perlpath  = "$Config{perlpath}";
+my \$startperl;
+my \$perlpath;
+(\$startperl = <<'/../') =~ s/\\s*\\z//;
+$Config{startperl}
+/../
+(\$perlpath = <<'/../') =~ s/\\s*\\z//;
+$Config{perlpath}
+/../
 !GROK!THIS!
 
 # In the following, perl variables are not expanded during extraction.
@@ -48,12 +54,14 @@ use Symbol;
 
 =head1 NAME
 
-sed - a stream editor
+psed - a stream editor
 
 =head1 SYNOPSIS
 
-   sed [-an] script [file ...]
-   sed [-an] [-e script] [-f script-file] [file ...]
+   psed [-an] script [file ...]
+   psed [-an] [-e script] [-f script-file] [file ...]
+
+   s2p  [-an] [-e script] [-f script-file]
 
 =head1 DESCRIPTION
 
@@ -1954,5 +1962,14 @@ way you wish, provided you do not restrict others from doing the same.
 
 close OUT or die "Can't close $file: $!";
 chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
+unlink 'psed';
+print "Linking s2p to psed.\n";
+if (defined $Config{d_link}) {
+  link 's2p', 'psed';
+} else {
+  unshift @INC, '../lib';
+  require File::Copy;
+  File::Copy::syscopy('s2p', 'psed');
+}
 exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
 chdir $origdir;