Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^3: strawberry win10 no ARGV

by pryrt (Prior)
on Dec 14, 2019 at 22:46 UTC ( #11110157=note: print w/replies, xml ) Need Help??

in reply to Re^2: strawberry win10 no ARGV
in thread strawberry win10 no ARGV

your file association is wrong. You need %* after the "%1" in the command your association runs.

Replies are listed 'Best First'.
Re^4: strawberry win10 no ARGV
by twyce (Initiate) on Dec 14, 2019 at 22:49 UTC
    I guess you're joking? Anyhow why can't I call one script from another script and send it @ARGV ?
      I guess you're joking?


      Anyhow why can't I call one script from another script and send it @ARGV ?

      Because your association is wrong; to quote myself, when I wasn't joking, "You need %* after the "%1" in the command your association runs".

      Since that wasn't enough information for you, here are more details: A .pl is not an executable file from Window's perspective. It has to be associated with an application (perl.exe, in this case), otherwise Windows cannot do anything with it. If you didn't have an association, you wouldn't get the script to run at all by just calling, with or without arguments after it. Since it runs, but just doesn't pass arguments, I can nearly guarantee that there is an association, but that it is only passing the .pl filename to the script (with "%1"), and not any additional arguments you pass (with %*). If you want Windows to pass the command line arguments, "You need %* after the "%1" in the command your association runs". The symptoms you describe indicate that your association doesn't have the %* it needs.

      Run regedit, then navigate to HKEY_CLASSES_ROOT\.pl. The default value will say something like auto_pl_file or PerlScript, or something like that. Navigate to HKEY_CLASSES_ROOT\auto_pl_file or whatever it was called; there will be a subkey called shell, with a subkey something like run, with a subkey called command. The default value for the command will be similar to c:\strawberry\perl\bin\perl.exe "%1", where the path to perl.exe will be wherever your copy of strawberry perl is; you need to change it c:\strawberry\perl\bin\perl "%1" %*, with the %* included. If the %1 is not in quotes, put it in quotes, otherwise any script that has a filename or path element that has a space will not work either.

        Shouldn't Strawberry Perl automatically set this up during installation? I don't understand why people have to do this manually. :/
        I have near zero recent experience with REGEDIT. I don't find any subkeys. Is there a trick? In ".pl" folder there is one entry: Name= Default Type= REG_SZ Data= pl_auto_file
        I make some changes to regedit which didn't seem to help. However i found when the first argument is the full path to perl.exe everything works! either from the cmd line or using qx inside the wrapper script.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11110157]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (11)
As of 2020-06-03 10:36 GMT
Find Nodes?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?

    Results (22 votes). Check out past polls.