use strict;
use warnings;
print @ARGV;

将上面的代码保存为 test.pl ,然后进入 cmd 执行:  test.pl a b c

试试看




在2010-03-15 11:01:50,"Kaiwang Chen" <[email protected]> 写道:
>可以啊
>C:\Documents and Settings\DevUser>perl -e "print join ',',@ARGV;" x y
>x,y
>
>在 2010年3月15日 上午10:57,Huangj <[email protected]> 写道:
>> cmd 中不能给 perl 传递命令行参数?   -- strawberry
>>
>>
>> --
>> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
>> 要向此网上论坛发帖,请发送电子邮件至 [email protected]。
>> 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。
>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>
>
>-- 
>您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>要向此网上论坛发帖,请发送电子邮件至 [email protected]。
>要取消订阅此网上论坛,请发送电子邮件至 [email protected]。
>若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>

-- 
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 [email protected]。
要取消订阅此网上论坛,请发送电子邮件至 [email protected]。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

回复