why cmd can not catch @ARGV?

why cmd can not catch @ARGV?

Post by lsyx » Tue, 18 Nov 2008 11:13:44


I use Active Perl on Windows and had set the %PATHEXT%=%PATHEXT
%;.PL;
When I use the script a.pl on cmd.exe,
"perl a.pl xxx" can work correctly.
"a xxx" can not catch @ARGV.
I don't know how to config it?
thanks very much.
-----------CMD---------
E:\tmp>perl a.pl xxx
a.pl start
xxx
a.pl end

E:\tmp>a.pl xxx
a.pl start

a.pl end

E:\tmp>a xxx
a.pl start

a.pl end
-----------CMD---------
 
 
 

why cmd can not catch @ARGV?

Post by Jgen Exne » Tue, 18 Nov 2008 11:34:30


Let me paraphrase to make sure I understand your problem correctly.

When calling a Perl program using
perl a.pl xxx
then the parameter xxx is passed to the program correctly.
However when calling like
a.pl xxx
or like
a xxx
then the parameter xxx is no passed to the program.

The reason is a broken setting for the "Open" action for files of type
PL. The line for "Application used to perfom action" must end with
%*
in order for all the parameters to be passed from cmd to perl.

jue

 
 
 

why cmd can not catch @ARGV?

Post by lsyx » Tue, 18 Nov 2008 12:27:54

thanks a lot.
I fixed it In the Windows Explorer->Tools > Folder Options > File
Types tab > PL file type > advanced ...