PERL for Biologists

Course by Kurt Stüber

Previous, Part 6 ,Next


Subroutines are a good way to structure your program into manageable parts. If in your program task appear several times you should no write the same code again but put it into a subroutine and call the subroutine several times. Subroutines should be written to be reusable, i.e. the code should independent from the rest of the program with the exceptions of the a parameters that enter and leave the subroutine.



$line = s/Karl/Fred/g;



© 2001-2007, by Kurt Stüber.