summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2002-04-15 16:48:36 -0500
committerAbhijit Menon-Sen <ams@wiw.org>2002-04-16 02:16:35 +0000
commit9ae2b9a01756a2a2ea4071ab263cdb052d634e1a (patch)
tree1045589d70fded42e615dc5146906ca643106985
parentc72515e3b3831d7662a8502dab05d997460b04a5 (diff)
downloadperl-9ae2b9a01756a2a2ea4071ab263cdb052d634e1a.tar.gz
s2p fix for VMS
From: "Craig A. Berry" <craigberry@mac.com> Message-Id: <a05101500b8e13f80e770@[172.16.52.1]> p4raw-id: //depot/perl@15941
-rw-r--r--configure.com1
-rwxr-xr-xt/x2p/s2p.t9
-rw-r--r--x2p/s2p.PL4
3 files changed, 12 insertions, 2 deletions
diff --git a/configure.com b/configure.com
index 14a2aafc0b..7dda531dd2 100644
--- a/configure.com
+++ b/configure.com
@@ -5656,6 +5656,7 @@ $ WC "path_sep='|'"
$ WC "perl_root='" + perl_root + "'" ! VMS specific $trnlnm()
$ WC "perladmin='" + perladmin + "'"
$ WC "perllibs='" + perllibs + "'"
+$ WC "perlpath='" + "''vms_prefix':[000000]Perl''ext'" + "'"
$ WC "perl_symbol='" + perl_symbol + "'" ! VMS specific
$ WC "perl_verb='" + perl_verb + "'" ! VMS specific
$ WC "pgflquota='" + pgflquota + "'"
diff --git a/t/x2p/s2p.t b/t/x2p/s2p.t
index 15219fc987..50d2483f53 100755
--- a/t/x2p/s2p.t
+++ b/t/x2p/s2p.t
@@ -789,6 +789,11 @@ my $plsed = "s2pt$$.pl";
# various command lines for
my $s2p = File::Spec->catfile( File::Spec->updir(), 'x2p', 's2p' );
my $psed = File::Spec->catfile( File::Spec->curdir(), 'psed' );
+if ($^O eq 'VMS') {
+ # default in the .com extenson if it's not already there
+ $s2p = VMS::Filespec::rmsexpand($s2p, '.com');
+ $psed = VMS::Filespec::rmsexpand($psed, '.com');
+}
my $sedcmd = [ $psed, '-f', $script, $stdin ];
my $s2pcmd = [ $s2p, '-f', $script ];
my $plcmd = [ $plsed, $stdin ];
@@ -830,6 +835,10 @@ for my $tc ( sort keys %testcase ){
close( IN ) || goto FAIL_BOTH;
}
+ # on VMS, runperl eats blank lines to work around
+ # spurious newlines in pipes
+ $testcase{$tc}{expect} =~ s/\n\n/\n/ if $^O eq 'VMS';
+
# run and compare
#
$psedres = runperl( args => $sedcmd );
diff --git a/x2p/s2p.PL b/x2p/s2p.PL
index 9a084f9ce5..9b62caac9c 100644
--- a/x2p/s2p.PL
+++ b/x2p/s2p.PL
@@ -43,7 +43,7 @@ $Config{perlpath}
print OUT <<'!NO!SUBS!';
-$0 =~ s/^.*?(\w+)$/$1/;
+$0 =~ s/^.*?(\w+)[\.\w]*$/$1/;
# (p)sed - a stream editor
# History: Aug 12 2000: Original version.
@@ -1795,7 +1795,7 @@ if( $doGenerate ){
#!$perlpath -w
eval 'exec $perlpath -S \$0 \${1+"\$@"}'
if 0;
-\$0 =~ s/^.*?(\\w+)\$/\$1/;
+\$0 =~ s/^.*?(\\w+)\[\\.\\w+\]*\$/\$1/;
use strict;
use Symbol;