X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=x2p%2Fs2p.PL;h=21a5ee89279d62c1bba94f3c4c4fe856633865c6;hb=86a59229552fc742ed09795227799fb41537f06f;hp=29864b418a678077d4099711739be2f55683e774;hpb=f360dba143c864a53fdb1573b40795cfe2331220;p=p5sagit%2Fp5-mst-13.2.git diff --git a/x2p/s2p.PL b/x2p/s2p.PL index 29864b4..21a5ee8 100644 --- a/x2p/s2p.PL +++ b/x2p/s2p.PL @@ -1,7 +1,8 @@ -#!/usr/local/bin/perl +#!/usr/bin/perl use Config; use File::Basename qw(&basename &dirname); +use Cwd; # List explicitly here the variables you want Configure to # generate. Metaconfig only looks for shell variables, so you @@ -12,10 +13,10 @@ use File::Basename qw(&basename &dirname); # This forces PL files to create target in same directory as PL file. # This is so that make depend always knows where to find PL derivatives. -chdir(dirname($0)); -($file = basename($0)) =~ s/\.PL$//; -$file =~ s/\.pl$// - if ($^O eq 'VMS' or $^O eq 'os2'); # "case-forgiving" +$origdir = cwd; +chdir dirname($0); +$file = basename($0, '.PL'); +$file .= '.com' if $^O eq 'VMS'; open OUT,">$file" or die "Can't create $file: $!"; @@ -25,757 +26,1933 @@ print "Extracting $file (with variable substitutions)\n"; # You can use $Config{...} to use Configure variables. print OUT <<"!GROK!THIS!"; -$Config{'startperl'} - eval 'exec perl -S \$0 "\$@"' - if 0; -\$startperl = "$Config{startperl}"; +$Config{startperl} + eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}' + if \$running_under_some_shell; +my \$startperl = "$Config{startperl}"; +my \$perlpath = "$Config{perlpath}"; !GROK!THIS! # In the following, perl variables are not expanded during extraction. print OUT <<'!NO!SUBS!'; -# $RCSfile: s2p.SH,v $$Revision: 4.1 $$Date: 92/08/07 18:29:23 $ +$0 =~ s/^.*?(\w+)$/$1/; + +# (p)sed - a stream editor +# History: Aug 12 2000: Original version. + +use strict; +use integer; +use Symbol; + +=head1 NAME + +sed - a stream editor + +=head1 SYNOPSIS + + sed [-an] script [file ...] + sed [-an] [-e script] [-f script-file] [file ...] + +=head1 DESCRIPTION + +A stream editor reads the input stream consisting of the specified files +(or standard input, if none are given), processes is line by line by +applying a script consisting of edit commands, and writes resulting lines +to standard output. The filename `C<->' may be used to read standard input. + +The edit script is composed from arguments of B<-e> options and +script-files, in the given order. A single script argument may be specified +as the first parameter. + +If this program is invoked with the name F, it will act as a +sed-to-Perl translator. See L<"sed Script Translation">. + +B returns an exit code of 0 on success or >0 if an error occurred. + +=head1 OPTIONS + +=over 4 + +=item B<-a> + +A file specified as argument to the B edit command is by default +opened before input processing starts. Using B<-a>, opening of such +files is delayed until the first line is actually written to the file. + +=item B<-e> I