Krishna74 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have installed strawberry perl in one windows user. And is working as expected. But, when i add another windows user, perl interpreter is not accepting the aruguments. Please let me know is there any changes are required. Thanks in Advance

Replies are listed 'Best First'.
Re: perl interpreter issue
by Marshall (Canon) on Feb 02, 2020 at 08:01 UTC
    Did you install Perl under an account with admin privileges and so that all users can access it?
    Under Windows, user X can install a program that user Y cannot access.
      Yes. I have installed the strawberry perl under all users with admin rights.
Re: perl interpreter issue
by bliako (Abbot) on Feb 02, 2020 at 13:25 UTC
    perl interpreter is not accepting the aruguments.

    I can not help with windows but if you clarify the above you may get more help. Does it mean that perl runs but does not accept command line arguments? Or perl does not run at all?

      Perl is working fine. But, arguments is not accepting. perl test.pl welcome - working fine. test welcome - is not working. But, in another user account working as expected

        In each of your user accounts, open up a cmd.exe window and run

        REG QUERY HKEY_CURRENT_USER\Software\Classes\.pl /S
        . If you have per-user configuration, this will pop up something like
        HKEY_CURRENT_USER\Software\Classes\.pl (Default) REG_EXPAND_SZ PerlScript
        . Now, using your value on the right instead of PerlScript below, run
        REG QUERY HKEY_CURRENT_USER\Software\Classes\PerlScript /S
        . There should be one similar to
        HKEY_CURRENT_USER\Software\Classes\PerlScript\shell\run\command (Default) REG_EXPAND_SZ "c:\usr\local\apps\berrybrew\perls\s +ystem\perl\bin\perl.exe" "%1" %*
        , which has a key name of "command", and runs perl.exe. You need to make sure that it has a "%1" (with quotes!), which indicates the name of the script, and the %* (no quotes!), which indicates any additional command line arguments to be passed to the script.

        If you did a "for all users" install, instead of being in that location, you might need to look in HKEY_CLASSES_ROOT\.pl and HKEY_CLASSES_ROOT\PerlScript (or whatever the right value is) using the same REG QUERY syntax, but with the new key location.

        If the working user has "%1" %* and the broken user just has "%1" (or worse, just %1 without quotes), then the broken user doesn't have the right association.

        If the working user has one or both of the HKEY_CURRENT_USER and the HKEY_CLASSES_ROOT, but the broken user has neither, then the association wasn't created at all for the broken user, and that will need to be fixed.

        Also, you mentioned running perl test.pl, so the script obviously ends in .pl. However, you then try to run it as test welcome, without the .pl. For that to work, you need PATHEXT set properly for all users who try. Thus, for each user, in the same cmd.exe, run echo %PATHEXT%. It needs to include .PL somewhere in the list; mine, for example, is .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PL, with the .PL at the end of the list.

        If any of your users are missing either the correct command value, or the .PL in the PATHEXT, those will need to be fixed. If you need help fixing those, please paste in between <code>...</code> tags the results of the various REG QUERY and echo %PATHEXT% commands above for both the working and the broken user (telling us which is which), and we can try to help you get those fixed.