我是一个完整的 perl 新手,正在使用 perl 5.10 运行 perl 脚本并收到以下警告:
$* is no longer supported at migrate.pl line 380.
谁能描述一下 $* 做了什么以及现在推荐的替代品是什么?或者,如果您可以向我指出描述这一点的文档,那就太好了。
我正在运行的脚本是将源代码数据库从 vss 迁移到 svn,可以在这里找到: http ://www.x2systems.com/files/migrate.pl.txt
使用它的两个代码片段是:
$* = 1;
$/ = ':';
$cmd = $SSCMD . " Dir -I- \"$proj\"";
$_ = `$cmd`;
# what this next expression does is to merge wrapped lines like:
# $/DeviceAuthority/src/com/eclyptic/networkdevicedomain/deviceinterrogator/excep
# tion:
# into:
# $/DeviceAuthority/src/com/eclyptic/networkdevicedomain/deviceinterrogator/exception:
s/\n((\w*\-*\.*\w*\/*)+\:)/$1/g;
$* = 0;
然后是一些方法:
$cmd = $SSCMD . " get -GTM -W -I-Y -GL\"$localdir\" -V$version \"$file\" 2>&1";
$out = `$cmd`;
# get rid of stupid VSS warning messages
$* = 1;
$out =~ s/\n?Project.*rebuilt\.//g;
$out =~ s/\n?File.*rebuilt\.//g;
$out =~ s/\n.*was moved out of this project.*rebuilt\.//g;
$out =~ s/\nContinue anyway.*Y//g;
$* = 0;
非常感谢,
- 罗里