1 / 30

Perl part 1

Perl part 1. What is perl?. Why perl ?. Good for bioinformatics and web programming Suit for all the operating systems Suit for all kinds of computer Ease of Programming Rapid Prototyping Portability, Speed, and Program Maintenance. Versions of Perl. Perl Version 5

aspen
Download Presentation

Perl part 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Perl part 1

  2. What is perl?

  3. Why perl? • Good for bioinformatics and web programming • Suit for all the operating systems • Suit for all kinds of computer • Ease of Programming • Rapid Prototyping • Portability, Speed, and Program Maintenance

  4. Versions of Perl • Perl Version 5 • The current version of Perl is 5.8.8. • Perl Version 6 in progress

  5. Installing Perl on Your Computer • $ perl -v • Downloading Unix,Linux:http://www.perl.com/download.csp • Perl for Win32 --http://www.activestate.com/ActivePerl/

  6. How to Run Perl Programs • Windows : typing this_program in an MS-DOS command window or by typing perlthis_program.pl. Linux: make the program executable using the chmod program : chmod 755 this_program OR perl /usr/local/bin/this_program

  7. Text Editors • Linux :vi and emacs • Windows:Notepad ;word;

  8. Good start for Programming • Take classes of many different kinds • Read a tutorial book like this one • Get the programming manuals and plunge in • Be tutored by a programmer • Identify a program you need • Try any and all of the above until you've managed to write the program • Edit—Run—Revise (and Save)

  9. Scalar Data • A scalar is the simplest kind of data that Perl manipulates. Most scalars are a number (like 255 or 3.25e20) or a string of characters (like hello[ ] or the Gettysburg Address).

  10. Numbers • Floating-Point Literals • Integer Literals • Non-Decimal Integer Literals

  11. Numeric Operators

  12. Strings • Strings are sequences of characters (like hello). Strings may contain any combination of any characters.The shortest possible string has no characters. The longest string fills all of your available memory.

  13. Single-Quoted String Literals A single-quoted string literal is a sequence of characters enclosed in single quotes. The single quotes are not part of the string itself but are there to let Perl identify the beginning and the ending of the string.

  14. Double-Quoted String Literals • A double-quoted string literal is similar to single-quoted string literal , But now the backslash takes on its full power to specify certain control characters or any character through octal and hex representations.

  15. String Operators

  16. Automatic Conversion Between Numbers and Strings • Check the operator

  17. Perl's Built-in Warnings • -w option • $ perl -w my_program • #!/usr/bin/perl -w

  18. Scalar Variables • A variable is a name for a container that holds one or more values • A scalar variable holds a single scalar value as you'd expect. Scalar variable names begin with a dollar sign $ • can't start with a digit

  19. Scalar Assignment • The most common operation on a scalar variable is assignment, which is the way to give a value to a variable. The Perl assignment operator is the equals sign = (much like other languages), which takes a variable name on the left side and gives it the value of the expression on the right:

  20. Binary Assignment Operators

  21. Output with print

  22. Lists and Arrays • A list is an ordered collection of scalars. An array is a variable that contains a list.

  23. List Literals

  24. sign (@) before the name of the array

More Related