loek32z
loek32z

Reputation:

How do I invoke a Perl script on Windows?

I tried compile apache 2.2, my Visual Studio 2008 returned error on RC. After some googling, I found this explanation:

What appears to have happened is that you've opened it up unsuccessfully in Visual Studio; before you convert to an .sln file + .vcproj files, it's important to invoke the perl script

perl srclib\apr\build\cvtdsp.pl -2005

which will do evil things to the .dsp file syntax, breaking them forever but allowing us to work around a visual studio bug. Then, load the Apache.dsw into a modern visual studio; it should 'just work'.

Can anyone explain to me how to invoke Perl script on Windows?

Thank you

Upvotes: 0

Views: 599

Answers (3)

Yordan Georgiev
Yordan Georgiev

Reputation: 5460

I tend to use in my perl scripts always a short cmd file with the same name as the script to set some initial variables and call the actual script : The benefits ?! Portability to Unix and Linux is easier when you wrap all of the logic in the Perl script and the sh or cmd files are just setting some basic kick off vars :

Something like :

    set _BaseDir=E:\Perl\sfw
    set _ProjectName=logger
    set _ProjectVersion=0.6.0
    set _ProjectVersionDir=%_BaseDir%\%_ProjectName%\%_ProjectName%.%_ProjectVersion%

    set _PerlScript=%_ProjectVersionDir%\%_ProjectName%.pl
    set _CmdScript=%_ProjectVersionDir%\%_ProjectName%.cmd


    :: Action !!!
    perl %_PerlScript% 

    :: ping localhost -n 5
    pause

Upvotes: 0

Julien Roncaglia
Julien Roncaglia

Reputation: 17837

The two distributions of Perl for Windows that you could get are

  • Strawberry Perl (A new distribution that integrates a C compiler to have the CPAN archive fully working on Windows)
  • ActivePerl (The most common distribution but the CPAN doesn't work)

Just install one of them as this script doesn't seem to use any thing fancy.

Upvotes: 7

Sizemj
Sizemj

Reputation: 322

Also since it is Windows make sure the Perl interpretor is in your system path.

Upvotes: 0

Related Questions