How can I install and use ack library on Windows? How can I install and use ack library on Windows? windows windows

How can I install and use ack library on Windows?


Start by installing perl http://strawberryperl.com/

Install App::Ack by typing (in a windows command shell)

C:\>cpan App::Ack

And undoubtedly this will prove useful http://learn.perl.org/


Not all the tests pass on all versions of Windows. You can most likely get 100% functionality from ack even if the install tests fail. Here is the command to force installation if failing tests prevent a normal install:

perl -MCPAN -e "CPAN::Shell->force(qw(install App::Ack));"


If you already have msysgit installed, then you don't need to install Perl, because you already have a version. You just need to download the standalone version of ack and put it somewhere in your bash path1. You can then run ack from your msysgit bash prompt.

If you also want to be able to run ack from the Windows command prompt, then you will need to create a batch script somewhere in your Windows path2 with the contents:

@"C:\Program Files\Git\bin\perl" C:\path\to\ack-standalone.pl %*

(You'll obviously need to edit the paths above to match your msysgit installation and where you placed the ack script.)

1: I just stuck mine in the mysysgit bin directory: C:\Program Files\Git\bin\ack. This isn't the most sensible location for it, but it works.
2: Again, I just created the file ack.bat in the msysgit bin directory C:\Program File\Git\bin.