Program: Bioinformatics is Fun
The main idea of this program is to show you how to create and run a Perl program on your computer. This is the line of code that you will enter in your chosen text editor. The most commonly used text editor is notepad.
#!/usr/bin/perl -w
print "Bioinformatics is fun. \n";
exit;
The instructions for opening and creating this program are listed below according to the operating system.
Windows
1. Create a new folder in your C: drive, and name it perlbio. The directory for your file should be C:\perlbio. Your program will be placed in this folder.
2. Open your text editor and enter the lines of code into your text editor.
3. Save the file as fun.pl. (Make sure the file is not saved fun.pl.txt!)
4. The file must be open in MS-DOS prompt to view the program. Open the MS-DOS prompt and type cd C:\perlbio and then press return.
5. Then type fun.pl and press return.
6. This should be the correct result printed in the window: Bioinformatics is fun.
Macs
This information is an excerpt from Beginning Perl for Bioinformatics.
Save Perl programs as droplets as shown from the MacPerl documentation. The basic procedure to do this is as follows:
1. Open the Perl program with the MacPerl application.
2. Choose Save As
3. Select the Type option Droplet
Explanation for Program
Line #1: #!/usr/bin/perl -w
This line informs Unix that the file is a Perl program. Perl also reads this line to see if there is any special commands. For example, the -w command is turned on. This command causes warning reporting in the program.
Line #2: print "Bioinformatics is fun. \n";
Line two, along with line three, is a statement. Just like a sentence ends in a period in the English language, a statement ends in a semicolon in Perl. There are many types of statements in Perl.
"Bioinformatics is fun.\n";
This part of line #2 is called the string. A string is designated by quotes.
This is a command that Perl reads and responds to accordingly. The print command in this line is instructing Perl to print the string.
\n
This is the new line of the second line. This instructs Perl to start a new line.
Line #3: exit;
The exit command tells the computer to exit the program.
Great job on completing your first Perl program!
Resources
Tisdall, James. Beginning Perl for Bioinformatics. 1st ed. Sebastopol, California: O'Reilly Media, Inc., 2001. Print.
Published by Katie
An Introduction to Programming in PerlPerl is a versatile programming language created by Larry Wall in 1987. He designed this language to extract and manipulate text files. It has since grown into a rich programmin...- Bioinformatics, SAS and Oracle Clinical Training and ProjectsAn affordable place to learn bioinformatics, sas, oracle clinical, spss, etc.
- Getting Started with ActivePerlThis is the first part of my tutorial series, Basics of ActivePerl.
- Basics of ActivePerl VariablesIn this part of the series, I explain the meaning of ActivePerl variables.
- ActivePerl SubroutinesIn this part of the series, I explain Perl functions, also called subroutines.
- Regular Expressions in Perl for the Novice
- Multidimensional Arrays in Perl 5.0: A Boon to Bioperl (Part 1)
- Regex Modifiers in Perl
- Regular Expression Patterns in Perl
- Using Regular Expressions in Perl
- Regex Groupings in Perl
- How to Install and Configure Apache on Windows Vista to Run Perl Scripts



