Sep 16, 2016, 8:35 AM
Post #7 of 20
I'm going to walk back part of what I previously said.
Re: [BillKSmith] How to Get Perl to Automatically Look in Specific Directories for Scripts?
[In reply to]
When installing AS perl via an msi file, having it configure the file type association is an option which can be selected or not selected. In the past the default was not selected, but I think it's now selected by default. However, I've often come across cases where it didn't get configured correctly i.e, it didn't add the required parameters to allow the script to accept arguments.
Once the file type association is setup correctly, you can run the scripts directly, as Bill has shown, without calling perl.exe and passing it the script as an arg.
Just as with any other executable, if the script is not in the CWD, the OS will look for it in the %PATH% directories, which is what Bill was saying. If the OS can't find the script within one of those directories, you'll receive and error. This has nothing to do with perl, it's how the OS works.
If the script is not within one of the %PATH% directories or the CWD, then you MUST specify the full or relative path when executing the script. Again, this is not a perl config issue. It's how operating systems work.