Difference between revisions of "Perl in Windows"

From Bioinformatics Core Wiki
(Running Perl)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''Perl''' programming language is distributed by default in most Linux distributions and also in all Mac OS X versions up to now. However, Windows users need to install it by themselves.
+
'''Perl''' programming language is included by default in most Linux distributions and also in all Mac OS X versions up to day. Windows users need to install it by themselves.
  
 
* You can download last Perl version from Windows here: [http://strawberryperl.com/ Strawberry Perl]
 
* You can download last Perl version from Windows here: [http://strawberryperl.com/ Strawberry Perl]
 +
* YouTube step-by-step video on how to install Perl on Windows: [http://www.youtube.com/watch?v=1RHYPM6e55o Installation of Perl]
  
Below some screenshots and hints for starting to use Perl in Windows.
+
Below, there are some screenshots and some hints for starting to use Perl in Windows.
  
 
=== Find Windows terminal ===
 
=== Find Windows terminal ===
  
The easiest way to access to terminal in Windows is by typing its name. Of course, you can decide to make a shortcut link for future uses.
+
The easiest way for accessing the terminal in Windows is by typing its name in the launch bar or directly writing <code>CMD</code>. Of course, afterwards, you can decide to make a shortcut link in the desktop or in the Windows bar.
  
 
[[Image:Windows-command-prompt.png]]
 
[[Image:Windows-command-prompt.png]]
Line 17: Line 18:
 
At least, you should know:
 
At least, you should know:
 
* dir (list a directory content)
 
* dir (list a directory content)
* cd (change current directory)
+
* cd (change to a directory)
  
 
[[Image:Windows-command-prompt-in.png]]
 
[[Image:Windows-command-prompt-in.png]]
Line 27: Line 28:
 
=== Running Perl ===
 
=== Running Perl ===
  
Strawberry Perl adds the <code>perl</code> command to the Windows System and becomes accessible from the terminal.
+
Strawberry Perl adds <code>perl</code> command to Windows System. From that moment, it becomes available from the terminal.
Below you can see how a small 'Hello world' script, that we check its content by using <code>more</code> command, is launched.
+
Below you can see how a small 'Hello world' script is launches. We also check its content by using <code>more</code> command.
  
 
<code>perl hello.pl</code>
 
<code>perl hello.pl</code>
Line 35: Line 36:
  
 
[http://en.wikipedia.org/wiki/Shebang_%28Unix%29 Shebang] line (the first one of the script and starting with #!), typical of UNIX systems, is ignored in Windows.
 
[http://en.wikipedia.org/wiki/Shebang_%28Unix%29 Shebang] line (the first one of the script and starting with #!), typical of UNIX systems, is ignored in Windows.
 +
[[Category:Documentation]]

Latest revision as of 06:59, 3 April 2012

Perl programming language is included by default in most Linux distributions and also in all Mac OS X versions up to day. Windows users need to install it by themselves.

Below, there are some screenshots and some hints for starting to use Perl in Windows.

Find Windows terminal

The easiest way for accessing the terminal in Windows is by typing its name in the launch bar or directly writing CMD. Of course, afterwards, you can decide to make a shortcut link in the desktop or in the Windows bar.

Windows-command-prompt.png

Windows Terminal commands

Commands are not exactly the same as in UNIX (Linux & Mac OS X) systems.

At least, you should know:

  • dir (list a directory content)
  • cd (change to a directory)

Windows-command-prompt-in.png

As reference:

Running Perl

Strawberry Perl adds perl command to Windows System. From that moment, it becomes available from the terminal. Below you can see how a small 'Hello world' script is launches. We also check its content by using more command.

perl hello.pl

Windows-command-prompt-perl.png

Shebang line (the first one of the script and starting with #!), typical of UNIX systems, is ignored in Windows.

Bioinformatics Core Facility @ CRG — 2011-2024