Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^5: Win7, ASSOCiation , and @ARGV

by Not_a_Number (Parson)
on Mar 14, 2012 at 20:26 UTC ( #959661=note: print w/replies, xml ) Need Help??

in reply to Re^4: Win7, ASSOCiation , and @ARGV
in thread Win7, ASSOCiation , and @ARGV

FWIW (and I'm even iggeranter than you in this respect): my (32-bit) win config, which seems to be identical to yours and runs an identical version of perl (see above), gives the same response as yours to the esoteric query suggested by BrowserUK:

C:\>reg query HKLM\Software\Classes\Perl\Shell\Open\Command HKEY_LOCAL_MACHINE\Software\Classes\Perl\Shell\Open\Command (Default) REG_SZ "C:\Perl\bin\perl.exe" "%1" %*

And yet, I get the expected output from your program.

Replies are listed 'Best First'.
Re^6: Win7, ASSOCiation , and @ARGV
by ww (Archbishop) on Mar 14, 2012 at 20:36 UTC
    Now I don't know whether to say "Thank you" first... or to give priority to the "Ouch!"

    Nonetheless, your observation has to help point me to something odd about my setup.

    BTW, did you see BrowserUK's Re^5: Win7, ASSOCiation , and @ARGV? I suspect modifying his ref to Perl64 is another step to try... but I'm checking with him (and the 'morrass of technet, and other M$ docs').

      BTW, did you see BrowserUK's Re^5: Win7, ASSOCiation , and @ARGV?

      Yes, after I'd posted my above reply. But frankly, it's way over my head.

      But FWIW again, here's the full output of what I get from perl -V:

      As far as I remember, I didn't change any defaults during the AS installation...

        I've had the problem that if I executed on Win7:
        perl a b c
        the program got the parameters (in @ARGV) correctly, but if I executed: a b c
        the program would NOT receive the parameters. I searched the web for a solution and soon found that it was no ActiveState perl problem but more likely a filetype association problem in Windows (Win7). However all solutions changing the
        assoc .pl=Perl
        and the
        ftype Perl="C:\Perl\bin\perl.exe" "%1" %*
        or changing stuff in the registry still did not solve the puzzle for me. I did notice that the assoc .pl was not used somehow because if I added assoc .plx=Perl and renamed my program to myprog.plx
        myprog.plx a b c
        worked perfectly ! So then I read this problem on the Microsoft forum were the Win7 "feature" Default Programs was mentioned, I found the solution to my problem:

        Open Default Programs by clicking the Start button , and then click "Default Programs".

        Select "Associate a file type or protocol with a program" and select ".pl" and click on "Change program". There was already a Perl Command Line Interpreter specified as Recommended Programs but instead I clicked on Browse and selected the Perl.exe myself. After closing the "Associate a file type ..." screen, a b c
        executed like a charm, all parameters were correctly retrieved by my program. Hope that helps ...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://959661]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2017-08-18 11:38 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (300 votes). Check out past polls.