加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

在Windows 7中,使用ActivePerl @ARGV为空

发布时间:2020-12-14 04:35:00 所属栏目:Windows 来源:网络整理
导读:我有以下Perl脚本.我正在使用ActivePerl在 Windows 7中运行它: #!c:Perl64binperl.exe -wuse strict;my $mp3splt_exe = 'c:Program Files (x86)mp3spltmp3splt.exe';my $mp3splt_args = '-o "@n @f" -g "r%[@o @N]" -f -t 6.0';print @ARGV;my $filen
我有以下Perl脚本.我正在使用ActivePerl在 Windows 7中运行它:
#!c:Perl64binperl.exe -w

use strict;

my $mp3splt_exe = 'c:Program Files (x86)mp3spltmp3splt.exe';

my $mp3splt_args = '-o "@n @f" -g "r%[@o @N]"  -f -t 6.0';

print @ARGV;
my $filename = $ARGV[0];

print "$mp3splt_exe $mp3splt_args $filenamen";

(你可以看到,我正在为mp3splt创建一个包装:-))

当我这样运行它:

C:Program Files (x86)mp3splt>run_mp3splt.pl a

我得到这个:

Use of uninitialized value $filename in concatenation (.) or string at C:Program Files (x86)mp3spltrun_mp3splt.pl line 12.
c:Program Files (x86)mp3spltmp3splt.exe -o "@n @f" -g "r%[@o @N]"  -f -t 6.0

所以,首先,当我打印@ARGV时,没有打印出来,其次,当我分配$filename = $ARGV [0]时,$filename是undef,所以我得到警告.

那么我做错了什么?为什么没有将命令行参数传递给脚本?

我确定Windows 7不了解shebang行.如果使用perl run_mp3splt.pl a运行,会发生什么?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读