February 13, 2011

Install Strawberry Perl on Windows Environment

Strawberry Perl is the one of the best option for Perl on Windows Environment.


Strawberry Perl uses CPAN,sue to which all the up-to-date modules are available.Whenever any modules are newly added they are easily accessible.



StrawberryPerl comes with the MinGW compiler which is preconfigured C compiler due to which few XS modules can be accessed without modification and it comes with gcc,ld,make and other tools to build modules.


On Vista, you will need to authorize the installation process.
The configuration is self expainable. A "C:\strawberry" folder will be created.

If you selected to create an entry to the Windows program manager, you will find there:

On your computer, the files in the C:\strawberry directory are organized in that fashion:
  • \c     :-   contains tools to build modules found on CPAN
  • \cpan  :-   where your CPAN modules will be installed.
  • \licences :-   Gnu GPL (General Public License). This is the base of the open source philosophy. It basically says that software distributed under the GPL must include its source code. Any modification of the source and redistribution is allowed but the modified source must also be made public.
  • \perl :-    \perl\bin contains the perl.exe interpreter. 
\perl\lib contains the perl core source files and all the base perl modules.
  • \win32  :-  has the four web links cited above.


In order to see if the interpreter is installed correctly, open a command shell: Windows Start Menu -> type cmd  in the Search box for Vista or  Run box for XP
Check that c:\strawberry\perl\bin has been added at the end of your path by typing:
path
at the DOS prompt.


Finally, type.
perl -v


and you will get information about the version of Perl being installed.

And then you are good to go and enjoy programming Perl in Windows.


For the advance Perl programming different CPAN modules are used which are provides a better way to program in Perl.


Strawberry Perl  is an open source binary distribution of Perl for the Windows operating system. It includes a compiler and pre-installed modules that offer the ability to install XS CPAN modules directly from CPAN. cpanm can be installed by running   cpan App::cpanminus.


To install any module in Windows for Strawberry Perl need to open the command prompt and follow below steps :-


C:\strawberry\perl > perl -MCPAN  -e shell
cpan> install (module-name) 


and after this the installation will start. in this way any number of modules can be installed in Windows for Strawberry Perl.


The best website to refer for any Query related to Strawberry Perl on Windows  http://win32.perl.org/wiki/index.php?title=Strawberry_Perl#