Difference between revisions of "Perl in Windows"

From Bioinformatics Core Wiki
Line 7: Line 7:
 
=== 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 accesing the terminal in Windows is by typing its name in the launch bar. 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 17:
 
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 27:
 
=== 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>

Revision as of 15:48, 2 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 accesing the terminal in Windows is by typing its name in the launch bar. 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