Question

I'm running ActivePerl 5.8.8 build 822 on Win7 x64. We're working on a project that is about 60% C++, 15% perl, etc. The Perl is heavily used to link bits and pieces and various small utility applications together to create and pack our final data. So, for example, our VS2005 solution has post build events to create hard links to DLL's using a post build perl script which lives at some location on our development drive (it is part of PATH env var).

I found out quickly, that without explicitly putting "perl" to call the interpreter in-front of the postbuild.pl script call, it wouldn't accept command line arguments. I tested this further simply by going to the cmd window and doing the same with a "hello world" style perl script. No command line arguments were passed in when I say "bleh.pl arg1 arg2". But when I say "perl bleh.pl arg1 arg2" I get command line arguments.

When this failure occurs, perl reads zero command line arguments, and the @ARGV variable empty or null (whatever this crazy language does). So they're simply not passed in.

This is an issue because there are hundreds if not thousands of calls to perl scripts which I fear are not behaving correctly, and it is unreasonable to think I should have to prefix every .pl script invocation with perl explicitly, not to mention we're using version control and I don't want to commit all these garbage changes nor manage them in my stash.

PERL env var exists and points at the folder where the perl binary lives. As well as PATHEXT has .PL in it for perl scripts. Likewise, my PATH contains the folder entries to get to the scripts and to perl also.

Any help on how to figure this out would be immensely appreciated! Also, when I installed ActivePerl (I've done so many times now trying to figure this out). I allowed it to change my Path and associate file extensions in windows, which you would think would be the solution.

Thank you!

Was it helpful?

Solution

Try searching more. This question has your answer.

OTHER TIPS

Your association is broken (incomplete). First, open a console and execute

assoc .pl

You'll get something like

.pl=SOMETHING

Then, execute

ftype SOMETHING

You should get something like

SOMETHING="C:\SOMEWHERE\bin\perl.exe" "%1" %*

but you'll get something like the following instead:

SOMETHING="C:\SOMEWHERE\bin\perl.exe" "%1"

To fix it, execute

ftype SOMETHING="C:\SOMEWHERE\bin\perl.exe" "%1" %*
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top