Week Four Agenda Announcements Link of the week Review week three lab assignment This week’s expected outcomes Next lab assignment Break-out problems.

Slides:



Advertisements
Similar presentations
A Guide to Unix Using Linux Fourth Edition
Advertisements

The Linux Operating System Lecture 6: Perl for the Systems Administrator Tonga Institute of Higher Education.
Week Five Agenda Announcements Link of the week Review week four lab assignment This week’s expected outcomes Next lab assignment Break-out problems Read.
Week Four Agenda Announcements Link of the week Review week three lab assignment This week’s expected outcomes Next lab assignment Break-out problems.
CS 898N – Advanced World Wide Web Technologies Lecture 8: PERL Chin-Chih Chang
CS311 – Today's class Perl – Practical Extraction Report Language. Assignment 2 discussion Lecture 071CS Operating Systems I.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Introduction to Unix (CA263) Introduction to Shell Script Programming By Tariq Ibn Aziz.
Unix Shell Scripts. What are scripts ? Text files in certain format that are run by another program Examples: –Perl –Javascript –Shell scripts (we learn.
Week Four Agenda Announcements Link of the week Review week three lab assignment This week’s expected outcomes Next lab assignment Break-out problems.
Sydney Opera House. Week Three Agenda Administrative Issues Link of the week Review week two lab assignment This week’s expected outcomes Next lab assignment.
Introduction to Shell Script Programming
Introduction to Perl & BioPerl Dr G. P. S. Raghava Bioinformatics Centre Bioinformatics Centre IMTECH, Chandigarh Web:
1 Perl Perl basics Perl Elements Arrays and Hashes Control statements Operators OOP in Perl.
Perl Tutorial Presented by Pradeepsunder. Why PERL ???  Practical extraction and report language  Similar to shell script but lot easier and more powerful.
Week Four Agenda Announcements Link of the week Review week three lab assignment This week’s expected outcomes Next lab assignment Upcoming deadlines Lab.
Week Five Agenda Announcements Link of the week Review week four lab assignment This week’s expected outcomes Next lab assignment Break-out problems Read.
Week Three Agenda Administrative Issues Link of the Week Review Week Two Information This Week’s Expected Outcomes Next Lab Assignment Break-Out Problems.
CIS 218 Advanced UNIX1 CIS 218 – Advanced UNIX (g)awk.
Week Five Agenda Announcements Link of the week Review week four lab assignment This week’s expected outcomes Next lab assignment Break-out problems Read.
Week Five Agenda Announcements Link of the week Review week four lab assignment This week’s expected outcomes Next lab assignment Reading assignments Upcoming.
Week Five Agenda Announcements Link of the week Review week four lab assignment This week’s expected outcomes Next lab assignment Break-out problems Read.
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
Week Four Agenda Announcements Link of the week Review week three lab assignment This week’s expected outcomes Next lab assignment Break-out problems.
Week Four Agenda Announcements Link of the week Review week three lab assignment This week’s expected outcomes Next lab assignment Break-out problems.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Week Six Agenda Announcements (in-class question) Link of the week Review week four lab assignment This week’s expected outcomes Next lab assignment Review.
Introduction to Perl Yupu Liang cbio at MSKCC
Perl Language Yize Chen CS354. History Perl was designed by Larry Wall in 1987 as a text processing language Perl has revised several times and becomes.
Perl: Lecture 1 The language. What Perl is Merger of Unix tools – Very popular under UNIX – shell, sed, awk Programming language – C syntax Scripting.
Week Six Agenda Announcements Link of the week Review week four lab assignment This week’s expected outcomes Next lab assignment Break-out problems Upcoming.
Introduction to Unix – CS 21
Agenda Administrative Issues Link of the Week Review Week Two Information This Week’s Expected Outcomes Moving around in UNIX Break-Out Problems Upcoming.
5 1 Data Files CGI/Perl Programming By Diane Zak.
LIN Unix Lecture 7 Hana Filip. LIN Text Processing Command Line Utility Programs (cont.) sed LAST WEEK wc sort tr uniq awk TODAY join paste.
(A Very Short) Introduction to Shell Scripts CSCI N321 – System and Network Administration Copyright © 2000, 2003 by Scott Orr and the Trustees of Indiana.
Week Three Agenda Administrative Issues Link of the Week Review Week Two Information This Week’s Expected Outcomes Next Lab Assignment Break-Out Problems.
Perl Tutorial. Why PERL ??? Practical extraction and report language Similar to shell script but lot easier and more powerful Easy availablity All details.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
Chapter Twelve sed, awk & perl1 System Programming sed, awk & perl.
Sydney Opera House. Week Three Agenda Administrative Issues Link of the week Use of the Virtual Machine Review week two lab assignment This week’s expected.
Chapter Six Introduction to Shell Script Programming.
Week Three Agenda Administrative Issues Link of the week Review week two lab assignment This week’s expected outcomes Next lab assignment Upcoming deadlines.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Week Three Agenda Administrative Issues Link of the Week Review Week Two Information This Week’s Expected Outcomes Next Lab Assignment Break-Out Problems.
Department of Electrical and Computer Engineering Introduction to Perl By Hector M Lugo-Cordero August 26, 2008.
Sydney Opera House. Week Three Agenda Administrative Issues Link of the week Use of the Virtual Machine Review week two lab assignment This week’s expected.
Introduction to Perl. What is Perl Perl is an interpreted language. This means you run it through an interpreter, not a compiler. Similar to shell script.
Agenda Administrative Issues Link of the Week Review Week Two Information This Week’s Expected Outcomes Moving around in UNIX Break-Out Problems Upcoming.
Week Five Agenda Announcements Link of the week Review week four lab assignment This week’s expected outcomes Next lab assignment Break-out problems Read.
Agenda Administrative Issues Link of the Week Review Week Two Information This Week’s Expected Outcomes Next Lab Assignment Break-Out Problems Upcoming.
Week Five Agenda Link of the week Review week four lab assignment This week’s expected outcomes Next lab assignment Break-out problems Upcoming deadlines.
Week Four Agenda Link of the week Review week three lab assignment This week’s expected outcomes Next lab assignment Break-out problems Upcoming deadlines.
 History  Ease of use  Portability  Standard  Security & Privacy  User support  Application &Popularity Today  Ten Most Popular Programming Languages.
Week Four Agenda Announcements Link of the week Review week three lab assignment This week’s expected outcomes Next lab assignment Break-out problems.
Scripting Languages ● Perl, Python, Unix Shell, VB, JavaScript, etc. ● Glue Languages. ● Typeless. ● Interchangeable Code and Data. ● Interpreted vs. Compiled.
PERL By C. Shing ITEC Dept Radford University. Objectives Understand the history Understand constants and variables Understand operators Understand control.
Agenda Administrative Issues Link of the Week Review Week Two Information This Week’s Expected Outcomes Moving around in UNIX Break-Out Problems Upcoming.
PZ02CX Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ02CX - Perl Programming Language Design and Implementation.
Dept. of Animal Breeding and Genetics Programming basics & introduction to PERL Mats Pettersson.
CSC 4630 Perl 3 adapted from R. E. Beck. Problem But we worked on it first: Input: Read from a text file named in a command line argument Output: List.
Perl Subroutines User Input Perl on linux Forks and Pipes.
ITEC400 Week Five Robert D’Andrea. Agenda Administrative Issues Link of the Week Review Week Two Information This Week’s Expected Outcomes Moving around.
Week Four Agenda Announcements Link of the week Review week three lab assignment This week’s expected outcomes Next lab assignment Break-out problems.
Week Three Agenda Link of the Week Review Week Two Information
Perl Programming Language Design and Implementation (4th Edition)
Sydney Opera House.
Week Five Agenda Announcements Link of the week
Week Three Agenda Link of the Week Review Week Two Information
Presentation transcript:

Week Four Agenda Announcements Link of the week Review week three lab assignment This week’s expected outcomes Next lab assignment Break-out problems Upcoming deadlines Questions and answers

Link of the week Object Code What is object code? What format is object code in? How are object files applied where large systems are packaged? What is Executable and Linking Format?

Link of the week

Review week three lab assignment Perl is a simple language that compiles and executes like a shell or batch type file. Perl doesn’t impose special growth limitations on an array or data strings Perl is a composite of C, AWK, and Basic. Perl was originally developed to manipulate text information.

Review week three lab assignment Perl’s capabilities range from - System administration - Web development - Network programming - GUI development Perl’s major features are -Procedural Programming makes use of simple sequential steps, routines, subroutines, and methods. -Object Oriented Programming (OOP) makes use of “objects”. The key elements of are inheritance, modularity, polymorphism, and encapsulation.

Review week three lab assignment Perl ~ Shell $# Perl $ARGV[0] ~ Shell $1 Perl $ARGV[1] ~ Shell $2 Perl ~ Shell if [ $# != 2] All Perl statements are terminated with a “;” Perl exit 0 is returned if execution was successful Perl exit 1 is returned if execution fails The return value for a child process is returned to the parent process when the child process terminates.

Review week three lab assignment $? – this variable contains the return value # - precedes a comment statement in Perl \n - new line syntax “ …” $strexp = “This text is considered as a string”; ‘ …’ $charexp = ‘a’; ` …` $cmdexp = `ls – array containing command line arguments $_ - default implied scalar

Week four expected outcomes Write Perl scripts, including variables, control flow, and regular expression syntax

Next lab assignment Perl is designed to - Process text data - Perform pattern matching - Utilize string handling tasks Perl is available on many platforms - UNIX - Linux - HP-UX

Next Lab Assignment Perl utilizes two types of categories - Singular variables that represent a single-value. The variable prefix symbol for a scalar is the $. - Plural variables are ones that contain multiple-values. Arrays and hashes are two multi-valued variables. Perl data types $answer = 42; (an integer) $pi = ;(a “real” number) $animal = “horse”; (string) $statement = “I exercise my $animal”; (string with interpolation) $amount = ‘It cost me $5.00’; (string without interpolation) $cwd = `pwd`; (string output from a command)

Next Lab = (“car”, “mower”, “broom”); (an array is an ordered list of scalars, accessed by the scalar’s position in the = (“Will”, “Karim”, “Ann”, “Jay”); $count Demonstrate: week_four.pl script execution

Next Lab Assignment Filehandle is utilized for both input and output files. Most file names are cryptic and are meaningless to programmers. The purpose of a filehandle is to help the programmer remember a simple file name throughout a program. A filehandle is a name given for a file, device, socket, or pipe. Filehandle command line format: open(filehandle, file name, permissions, chmod); Example: open($FH,$file_name);

Next Lab Assignment # Checks and enforces correct number of arguments (intlist.pl) unless (Fill In Syntax)==(Fill in syntax)){ print "error: incorrect number of arguments", "\n", "usage: intlist a b (where a < b)", "\n"; exit 1; } # Checks that first argument is smaller than second if (Fill In Syntax){ print "error: first argument must be less than second argument", "\n", "usage: intlist a b (where a < b)", "\n"; exit 1; }

Next Lab Assignment # prints arguments else { $COUNTER=$(Fill In Syntax); # Sets counter to low integer # Prints integers until high integer is reached while($Fill In Syntax){ print $COUNTER; if ($COUNTER<$(Fill In Syntax)){ print ", "; } else { print "\n"; } $COUNTER(Fill In Syntax)1 } exit 0;

Next Lab Assignment # linenum.pl # Handles the enforcement of correct number of arguments unless (Fill In Syntax)==1){ print "error: incorrect number of arguments", "\n", "usage: linenum [filename]", "\n"; exit 1; } # Opens file from argument open((Fill In Syntax), "$(Fill In Syntax)") or die "error: argument must be a file\n", "usage: linenum [filename]\n$!\n";

Next Lab Assignment # Checks if file is a directory if (-d "$(Fill In Syntax)"){ print "error: argument must be a file", "\n", "usage: linenum [filename]\n"; exit 1; }

Next Lab Assignment $COUNTER=1; # Used for printing line numbers # Writes lines from file while ($LINE=(Fill In Syntax)){ # Adds leading zeros for numbers 1 digit long if ($COUNTER<10){ print “(Fill In Syntax)"; } # Adds leading zeros for numbers 2 digits long if (($COUNTER>9) && ($COUNTER<100)){ print "00"; } # Adds leading zeros for numbers 3 digits long if (($COUNTER>99) && ($COUNTER<1000)){ print "0"; } # Prints line number and line print "$COUNTER: $(Fill In Syntax)"; $COUNTER+=1; } exit 0;

Next Lab Assignment What is List = (6 - 4, 4 * 4, 8 / 2, 9 - 8); while ( … ) { … } for (counter = 0; counter < 10; counter++) { … } Three expressions are contained in a for loop: Set initial state of the loop variable Condition test the loop variable Modify the the state of the loop variable

Next Lab Assignment foreach VAR (List) { … } Demonstrate: foreach_global.pl script = ('Larry', 'Curly', 'Moe'); foreach { print $_; } Demonstrate: foreach.pl script execution

Next lab assignment Perl Program Statement #!/usr/bin/perl #!/usr/bin/perl -w Print continuation statement print "error: incorrect number of arguments", "\n", "usage: intlist a b (where a < b)", "\n"; Demonstrate: Execute linenum.pl and intlist.pl scripts.

Next lab assignment Demonstrate Execute arry_sort.pl script

Next lab assignment Programming Perl text book reading Chapter Three Chapter Four

Break-out problems $strexp = “This text is considered as a string”; $intexp = 10; $floatptexp = 2.54; $charexp = ‘a’; $cmdexp = `ls –l`; $argexp = (“two”, “four”, = (“Jackie”, “Vicki”, “Alex”); $arrayexp[0] = “new value”; $a = $b + 5; $container ($map{blue}, $map{orange}, $map{jade}) = (0xff0000, 0x00ff00, 0x0000ff0);

Upcoming deadlines Advanced Shell Script, 3-1 is due 9/30/08. Simple Perl Script, 4-1 is due 10/7/08. Mid-term outline to be posted on Bulletin Board by 10/5/08 Mid-term exam date 10/21/08.

Questions and answers Questions Comments Concerns After class I will help students with their scripts.