Perl Lab #11 Intro to Perl Debbie Bartlett. Perl Lab #1 2 Perl Practical Extraction and Report Language –or- Pathologically Eclectic Rubbish Lister Created.

Slides:



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

CSC 4630 Perl 1. Perl Practical Extraction and Support Language A glue language under UNIX Written by Larry Wall Claimed to be the most portable of scripting.
Introduction to Unix – CS 21 Lecture 11. Lecture Overview Shell Programming Variable Discussion Command line parameters Arithmetic Discussion Control.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX – The Master Manipulator perl Perl is.
Programming Perls* Objective: To introduce students to the perl language. –Perl is a language for getting your job done. –Making Easy Things Easy & Hard.
Introduction to Perl Bioinformatics. What is Perl? Practical Extraction and Report Language A scripting language Components an interpreter scripts: text.
CSET4100 – Fall 2009 Perl Introduction Scalar Data, Operators & Control Blocks Acknowledgements: Slides adapted from NYU Computer Science course on UNIX.
Perl Basics Chapters 1-6 of “Learning Perl” By Randal Schwartz, Tom Christiansen & Larry Wall; ISBN , 302 pages. Second Edition, July 1997.
CS311 – Today's class Perl – Practical Extraction Report Language. Assignment 2 discussion Lecture 071CS Operating Systems I.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
Introduction to Perl Learning Objectives: 1. To introduce the features provided by Perl 2. To learn the basic Syntax & simple Input/Output control in Perl.
Introduction to Perl. How to run perl Perl is an interpreted language. This means you run it through an interpreter, not a compiler. Your program/script.
Scripting Languages. Originally, a script was a file containing a sequence of commands that needed to be executed Control structures were added to make.
Perl Lecture #1 Scripting Languages Fall Perl Practical Extraction and Report Language -created by Larry Wall -- mid – 1980’s –needed a quick language.
Introduction to Perl Software Tools. Slide 2 Introduction to Perl l Perl is a scripting language that makes manipulation of text, files, and processes.
Guide to Linux Installation and Administration, 2e1 Chapter 6 Using the Shell and Text Files.
March 9, 2011CS 1921 JavaScript Debbie Bartlett March 9, 2011.
1 Intro to Linux - getting around HPC systems Himanshu Chhetri.
1 Operating Systems Lecture 3 Shell Scripts. 2 Shell Programming 1.Shell scripts must be marked as executable: chmod a+x myScript 2. Use # to start a.
1 Operating Systems Lecture 3 Shell Scripts. 2 Brief review of unix1.txt n Glob Construct (metacharacters) and other special characters F ?, *, [] F Ex.
Introduction to Perl Practical Extraction and Report Language or Pathologically Eclectic Rubbish Lister or …
8 Shell Programming Mauro Jaskelioff. Introduction Environment variables –How to use and assign them –Your PATH variable Introduction to shell programming.
Week Three Agenda Administrative Issues Link of the Week Review Week Two Information This Week’s Expected Outcomes Next Lab Assignment Break-Out Problems.
CS 105 Perl: Course Introduction Nathan Clement 13 May 2014.
GNU Compiler Collection (GCC) and GNU C compiler (gcc) tools used to compile programs in Linux.
1 System Administration Introduction to Scripting, Perl Session 3 – Sat 10 Nov 2007 References:  chapter 1, The Unix Programming Environment, Kernighan.
Sed, awk, & perl CS 2204 Class meeting 13 *Notes by Mir Farooq Ali and other members of the CS faculty at Virginia Tech. Copyright 2003.
Intro to Python Adriane Huber Debbie Bartlett Python Lab #1Python Lab #1 1.
Introduction to Perl Yupu Liang cbio at MSKCC
Chapter 9: Perl Programming Practical Extraction and Report Language Some materials are taken from Sams Teach Yourself Perl 5 in 21 Days, Second Edition.
Introduction to Unix – CS 21
1 Introduction to Perl CIS*2450 Advanced Programming Techniques.
Introduction to Perl “Practical Extraction and Report Language” “Pathologically Eclectic Rubbish Lister”
Scripting Languages James Brucker Computer Engineering Dept Kasetsart University.
Introduction to Perl William G. Dishman CUR/516 November 5, 2014.
Writing Scripts Hadi Otrok COEN 346.
CS 330 Programming Languages 10 / 02 / 2007 Instructor: Michael Eckmann.
Chapter Twelve sed, awk & perl1 System Programming sed, awk & perl.
Introduction to Perl October 4, 2004 Class Meeting 7 * Notes on Perl by Lenwood Heath, Virginia Tech © 2004.
16-Dec-15Advanced Programming Spring 2002 sed and awk Henning Schulzrinne Dept. of Computer Science Columbia University.
CPTG286K Programming - Perl Chapter 1: A Stroll Through Perl Instructor: Denny Lin.
Executable scripts. So far We have made scripts echo hello #for example And called it hello.sh Run it as sh hello.sh This only works from current directory?
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.
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.
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.
CS 330 Programming Languages 09 / 30 / 2008 Instructor: Michael Eckmann.
Perl Subroutines User Input Perl on linux Forks and Pipes.
 Prepared by: Eng. Maryam Adel Abdel-Hady
 Prepared by: Eng. Maryam Adel Abdel-Hady
Linux Administration Working with the BASH Shell.
 Prepared by: Eng. Maryam Adel Abdel-Hady
Perl & TCL Vijay Subramanian, Modified from : perl_basics_06.ppt.
CSE 303 Concepts and Tools for Software Development Richard C. Davis UW CSE – 10/9/2006 Lecture 6 – String Processing.
Organization of Programming Languages Meeting 37 April 18, 2016.
The full name of PERL is Practical extraction and report language. It is similar to shell script and lot easier & powerful language. Perl is free to download.
Introduction to Perl: Practical extraction and report language
Homework / Exams HW7 due today Exam #3 next class
CMIT100 Chapter 14 - Programming.
PERL.
PERL.
Kevin Taylor.
Perl Programming Language Design and Implementation (4th Edition)
Programming Basics Web Programming.
1 Python Lab #1 Intro to Python Adriane Huber Debbie Bartlett.
Perl for Bioinformatics
The Linux Command Line Chapter 24
Programming Perls* Objective: To introduce students to the perl language. Perl is a language for getting your job done. Making Easy Things Easy & Hard.
Introduction to Perl Learning Objectives:
The Linux Command Line Chapter 24
Presentation transcript:

Perl Lab #11 Intro to Perl Debbie Bartlett

Perl Lab #1 2 Perl Practical Extraction and Report Language –or- Pathologically Eclectic Rubbish Lister Created by Larry Wall in 1987  Originally developed when he found limitations in the tools he was using for report generation  Borrowed features from other languages such as C, shell scripting, AWK, sed, and Lisp Interpreted language Why use Perl?  Extract information from a text file and print out a report  Convert a text file into another form  Lots of other tasks!

Perl Lab #1 3 Perl Scripts Creating a Perl Script  Use a text editor such as gedit or emacs  Type in your program  Name the file filename.pl  Set execution permission bit, i.e. chmod 755 filename.pl Type the command name, filename.pl, at your terminal window shell prompt

Perl Lab #1 4 Sample Perl Script #! /usr/bin/perl print “What is your name?”; $name = ; chomp ($name); if ($name eq “Debbie”) { print (“Hello, Debbie! I am glad that you are in CS192 today!\n”); } else { print (“Hello, $name!\n”); # ordinary greeting }

Perl Lab #1 5 Perl1 Lab Assignment Type in your version of the Perl script (slide #4)‏ Ask a second question in your Perl script What happens if you leave out the chomp statement?  Take it out, try it, and then put it back What happens if you leave off the “;” after “What is your name? “  Take if off, try it, and then put it back What happens if you leave off the quote after “What is your name? – Take if off, try it, and then put it back Look in Google for “while” loop. Add a while loop to your Perl script?  Show your script to a lab instructor or helper