How do I make Perl scripts recognize parameters in the Win32 cmd console?

后端 未结 9 1239
时光说笑
时光说笑 2020-12-03 12:46

When I invoke my Perl scripts in the Windows environment without invoking perl first, the parameters are not passed to my script.

For example,



        
9条回答
  •  南笙
    南笙 (楼主)
    2020-12-03 13:19

    I found out what the problem was. Although the ftype and the assoc values were set as suggested, the actual behavior on my system seems to be determined by the registry key

    HKEY_CLASSES_ROOT\Applications\perl.exe\shell\open\command
    

    It should have a (Default) string value of "C:\Perl\bin\perl.exe" "%1" %*

    When I found this entry, it was set to "C:\Perl\bin\perl.exe" "%1". Changing it immediately fixed the problem.

    Why it was set that way in the first place? I don't know. Maybe from a previous installation?

    Anyway, thanks for the suggestions, and I hope this answer helps someone else, too.

提交回复
热议问题