简单问题,关于windows下的perl脚本文件的格式!up有分。

疯癫行者 2004-02-22 12:04:38
有下列脚本,windows下的,是一个.bat文件。
问题是:windows的批处理文件包含了perl脚本,其中批处理部分调用了如下代码:
ActivePerl\Perl\bin\perl -x -S "%0"
%0是指但前的.bat文件,意思是说让perl执行这个批处理脚本文件,但是perl如何才能知道哪些是windows的批处理,哪些是要执行的perl脚本呢?
"......"代表省略的代码。

希望各位高手能给个确定的答案!不确定的可不要写上来呀!up有分。

@rem = '--*-Perl-*--
@echo off
if "%OS%" == "Windows_NT" goto WinNT
ActivePerl\Perl\bin\perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
:WinNT
ActivePerl\Perl\bin\perl -x -S %0 %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
goto endofperl
@rem ';
#!ActivePerl/Perl/bin/perl -w
#line 15
#

......

# The path we will be replacing
my $replace = q[C:\p4view\Apps\Gecko\MSI\data\ActivePerl\Perl];

# The ActivePerl version we are installing
my $APVersion = Win32::BuildNumber();

......
...全文
118 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复

37,718

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧