in reply to It's the little things...
I found that all this time I was typing perl filename.pl could have just been typed filename.pl.
Depending upon how your perl was install, you may find that you can just type filename to run your perl scripts.
A way to check this (beyond just trying it), is to run the following command:
c:\test>set pathext PATHEXT=.pl;.COM;.EXE;.BAT;.CMD;;.wlua;.lexe
If .pl appears in the output (not necessarially at the beginning), then you probably can. To further check, try:
c:\test>assoc .pl .pl=Perl
And then:
c:\test>ftype Perl Perl="C:\perl64\bin\perl.exe" "%1" %*
And what all that tells you is that .pl is accepted as the extension for executable files. So, if you type filename, and there is a file called filename.pl in your path, then .pl will be looked up in the associations, (to find "Perl"), and that will be looked up in the ftype database and the command template found there will be used to construct the command that will be executed.
Hence, if I type filename, the command "c:\perl64\bin\perl.exe" "filename.pl" will be executed.
(I never understood why there is a two-stage lookup. There doesn't appear to be any way to have anything other than a one-to-one mapping. But that's how it is.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: It's the little things...
by Jenda (Abbot) on Mar 02, 2010 at 23:05 UTC |