Course plan



Basic perl programming for biological sciences
List of important functions/operators covered by each topic

topic title chapters in Learning Perl (6th ed.) key operators / functions more syntax
1
2
3
4
5
6
7
8
9
10

1 – introduction to unix command line and perl

Writing and running perl programs in a unix-style environment such as unix, linux or MacOS
Basic unix commands ({perl}ls{/perl}, {perl}cd{/perl}, {perl}less{/perl}, {perl}rm{/perl}, {perl}cp{/perl}, {perl}mv{/perl})
A simple perl script
output with {perl}print{/perl}

2 – scalar data and basic control structures

using numbers and strings, and storing them in variables
numeric and string operations
backslash escape characters
logical tests
interpolation
{perl}while{/perl} loops
getting input from the keyboard using {perl}{/perl}

3 – lists / arrays

Defining an array and accessing its elements
Adding and removing elements from an array
{perl}foreach{/perl} loops
the default variable {perl}$_{/perl}
sorting and reversing arrays

4 – subroutines

writing and invoking subroutines
arguments and return values
defining private variables using {perl}my{/perl}

5 – input/output

the diamond operator {perl}<>{/perl}
invocation arguments
filehandles for input and output to files

6 – hashes

Defining a hash and accessing its elements
keys and values of a hash

7 – regular expressions

using regular expressions for pattern matching
metacharacters
character classes
matching strings with the binding operator {perl}=~{/perl}
match variables ({perl}$1{/perl}, {perl}$2{/perl} etc.)
quantifiers
substitutions
global replacements
splitting and joining strings and arrays

8 – control structures

conditional control stuctures ({perl}if{/perl}, {perl}elsif{/perl}, {perl}else{/perl}, {perl}unless{/perl})
loops ({perl}while{/perl}, {perl}foreach{/perl}, {perl}until{/perl}, {perl}for{/perl})
loop controls ({perl}next{/perl}, {perl}last{/perl}, {perl}redo{/perl})
autoincrement/decrement
logical operators

9 – strings + sorting

manipulating strings using {perl}substr{/perl}
advanced sorting of arrays and hashes

10 – advanced: modules, file tests, directories

installing and using simple modules
introduction to bioperl
testing if files exist and other file tests
moving around directories
using globs to access a list of files