Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: What's #! got to do with it?

by Petras (Friar)
on Jan 16, 2004 at 21:26 UTC ( #321916=note: print w/ replies, xml ) Need Help??


in reply to Re: What's #! got to do with it?
in thread What's #! got to do with it?

Well, this is what happens when one is assimilated. When I ran .\hello.pl from a command (DOS) prompt, notepad opened with the script for editting :)

Rats, foiled again!
Petras

UPDATE: Even with correct shebang, calling the script from the DOS prompt via  .\hello.pl in win XP still launches notepad. Kinda makes you wanna launch windows...


Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats.

-Howard Aiken


Comment on Re: Re: What's #! got to do with it?
Select or Download Code
Re: Re: Re: What's #! got to do with it?
by bart (Canon) on Jan 16, 2004 at 21:29 UTC
    The shebang line doesn't matter on DOS/Windows, except for (CGI-)scripts for under Apache.
Re: Re: Re: What's #! got to do with it?
by Itatsumaki (Friar) on Jan 19, 2004 at 09:10 UTC

    You can fix that by changing the default action associated with the .pl extension. To do that you need to go to: explorer->tools->folder options->File Types->Extensions->PL->Advanced->Open->Edit

    If you set that to something like c:\Perl\bin\perl.exe" "%1" %* you will automatically invoke the perl interpreter rather than notepad.

    From this interface you can also add a separate option to be shown on right-click context menus. For example, you can set "Edit" as an option that uses notepad, but have it default to "Open" with the interpreter.

      Keep in mind that, at least on Win2k, that %* at the end will tell Windows to feed the entire rest of the line to your script, including redirects. So if you tried this:

      .\output.pl > anotherfile.txt
      @ARGV would look like this:
      @ARGV = ('>', 'anotherfile.txt');
      and the output would not be redirected. For that reason, I always use the perl script.pl version on Windows, which will work correctly with redirects.

      kelan


      Perl6 Grammar Student

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (13)
As of 2014-10-21 19:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (106 votes), past polls