in reply to perl interpreter issue

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?

Replies are listed 'Best First'.
Re^2: perl interpreter issue
by Krishna74 (Initiate) on Feb 03, 2020 at 16:19 UTC
    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.