summaryrefslogtreecommitdiff
path: root/win32/bin
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@engin.umich.edu>1997-07-07 00:40:58 +1200
committerTim Bunce <Tim.Bunce@ig.co.uk>1997-08-07 00:00:00 +1200
commit156a3eb7d0abfe7f8bcb0a4ba81b9e48f1777ab9 (patch)
treeb2aa0b35f2b1226ae64d2a1cb2d320d10352dd2a /win32/bin
parentf7c603cbfba7c97f77e257c42aa119ffdb47fe1e (diff)
downloadperl-156a3eb7d0abfe7f8bcb0a4ba81b9e48f1777ab9.tar.gz
win32 docs and runperl.bat
This patch fills in some gaps in the docs, and adds runperl.bat. The fix to pl2bat makes it so that a #!perl line is always available, so that "perl -x" always works on a batific file. This goes over my previous win32 patches (esp. the exec patch and the pl2bat patch). I'm going to post a consolidated win32 patch here soon, never fear. p5p-msgid: 199707070446.AAA29560@aatma.engin.umich.edu
Diffstat (limited to 'win32/bin')
-rw-r--r--win32/bin/pl2bat.bat3
-rw-r--r--win32/bin/runperl.bat20
2 files changed, 21 insertions, 2 deletions
diff --git a/win32/bin/pl2bat.bat b/win32/bin/pl2bat.bat
index f9b4902a13..73456531a8 100644
--- a/win32/bin/pl2bat.bat
+++ b/win32/bin/pl2bat.bat
@@ -43,9 +43,8 @@ sub process {
s/\.pl$//;
$_ .= '.bat' unless /\.bat$/ or /^-$/;
open( FILE, ">$_" ) or die "Can't open $_: $!";
- $myhead =~ s/perl -x/perl/ unless $linedone;
print FILE $myhead;
- print FILE "#line $headlines\n" unless $linedone;
+ print FILE "#!perl\n#line " . ($headlines+1) . "\n" unless $linedone;
print FILE @file, $tail;
close( FILE );
}
diff --git a/win32/bin/runperl.bat b/win32/bin/runperl.bat
new file mode 100644
index 0000000000..84f758d64e
--- /dev/null
+++ b/win32/bin/runperl.bat
@@ -0,0 +1,20 @@
+@rem = '--*-Perl-*--
+@echo off
+perl -x -S %0 %*
+goto endofperl
+@rem ';
+#!perl -w
+#line 8
+$0 =~ s|\.bat||i;
+unless (-f $0) {
+ $0 =~ s|.*[/\\]||;
+ for (".", split ';', $ENV{PATH}) {
+ $_ = "." if $_ eq "";
+ $0 = "$_/$0" , goto doit if -f "$_/$0";
+ }
+ die "`$0' not found.\n";
+}
+doit: exec "perl", "-x", $0, @ARGV;
+die "Failed to exec `$0': $!";
+__END__
+:endofperl