Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^8: Win7, ASSOCiation , and @ARGV

by Anonymous Monk
on Oct 11, 2012 at 12:14 UTC ( #998428=note: print w/ replies, xml ) Need Help??


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

I've had the problem that if I executed on Win7:

perl myprog.pl a b c
the program got the parameters (in @ARGV) correctly, but if I executed:
myprog.pl 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,

myprog.pl a b c
executed like a charm, all parameters were correctly retrieved by my program. Hope that helps ...


Comment on Re^8: Win7, ASSOCiation , and @ARGV
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (12)
As of 2015-07-30 19:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls