Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Windows .pl file assoc vs. cmd prompt

by Anonymous Monk
on Apr 08, 2005 at 14:15 UTC ( #446017=note: print w/replies, xml ) Need Help??

in reply to Windows .pl file assoc vs. cmd prompt

As far as I understand it, there's not really any way to know that.

Assuming you're using ActiveState Perl, the default action on files of type .pl is (approximately):

"d:\perl\bin\perl.exe" "%1" %*

for values of your AS Perl bin directory, of course. It calls perl, but not in any particularly special way.

You could maybe modify that to include a special option, like

"d:\perl\bin\perl.exe" "%1" "--I-was-double-clicked" %*

but that's an ugly hack, and it'll fail with scripts using Getopt::Long, because (IIRC) those scripts choke and die on command-line options they don't understand.

You might want to look into Win32 and Win32::GUI. I know it's possible to hide your console window using the latter, and if I can turn up the code in which I did that (a couple years ago), I'll post the relevant exemplary bits. I don't know much about the Win32 API interface in general, though, so can't be much help to you there.


  • Comment on Re: Windows .pl file assoc vs. cmd prompt

Replies are listed 'Best First'.
Re^2: Windows .pl file assoc vs. cmd prompt
by Anonymous Monk on Apr 08, 2005 at 14:16 UTC
    ...or I'm not half as smart as I think I am. Anyway...

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2018-07-20 16:58 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (438 votes). Check out past polls.