Organization of Programming Languages Meeting 37 April 18, 2016.

Slides:



Advertisements
Similar presentations
1/12 Steven Leung Very Basic Perl Tricks A Few Ground Rules File I/O and Formatting Operators, Flow Control Statements Regular Expression Subroutines Hash.
Advertisements

● Perl reference
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.
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.
CSET4100 – Fall 2009 Perl Introduction Scalar Data, Operators & Control Blocks Acknowledgements: Slides adapted from NYU Computer Science course on UNIX.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 12 Imperative Programming I really hate this.
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.
Practical Extraction & Report Language Picture taken from
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.
Perl Basics A Perl Tutorial NLP Course What is Perl?  Practical Extraction and Report Language  Interpreted Language Optimized for String Manipulation.
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.
Introduction to Perl Software Tools. Slide 2 Introduction to Perl l Perl is a scripting language that makes manipulation of text, files, and processes.
PHP Server-side Programming. PHP  PHP stands for PHP: Hypertext Preprocessor  PHP is interpreted  PHP code is embedded into HTML code  interpreter.
PERL Variables and data structures Andrew Emerson, High Performance Systems, CINECA.
Introduction to Perl Practical Extraction and Report Language or Pathologically Eclectic Rubbish Lister or …
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 By Gabe and Ted. History Perl was created by Larry Wall while working at NASA’s Jet Propulsion Labs. Larry Wall also created patch which is in widespread.
1 System Administration Introduction to Scripting, Perl Session 3 – Sat 10 Nov 2007 References:  chapter 1, The Unix Programming Environment, Kernighan.
Introduction to PHP A user navigates in her browser to a page that ends with a.php extension The request is sent to a web server, which directs the request.
Perl Practical(?)‏ Extraction and Report Language.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
COMP519: Web Programming Autumn 2010 Perl Tutorial: The very beginning  A basic Perl Program The first line Comments and statements Simple printing 
Introduction to Perl Giorgos Georgakilas Graduated from C.E.I.D.Graduated from C.E.I.D. M.Sc. degree in ITMBM.Sc. degree in ITMB Ph.D. student in DIANA-LabPh.D.
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.
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.
Programming Languages Meeting 14 December 9/10, 2014.
7 1 User-Defined Functions CGI/Perl Programming By Diane Zak.
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”
Introducing System Managers to Win32 Perl Programming Tim Christian College of Arts and Sciences Computing Support Services.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
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.
Department of Electrical and Computer Engineering Introduction to Perl By Hector M Lugo-Cordero August 26, 2008.
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.
Perl Lab #11 Intro to Perl Debbie Bartlett. Perl Lab #1 2 Perl Practical Extraction and Report Language –or- Pathologically Eclectic Rubbish Lister Created.
Computer Programming for Biologists Class 4 Nov 14 th, 2014 Karsten Hokamp
 History  Ease of use  Portability  Standard  Security & Privacy  User support  Application &Popularity Today  Ten Most Popular Programming Languages.
PERL By C. Shing ITEC Dept Radford University. Objectives Understand the history Understand constants and variables Understand operators Understand control.
CSC 4630 Meeting 17 March 21, Exam/Quiz Schedule Due to ice, travel, research and other commitments that we all have: –Quiz 2, scheduled for Monday.
The Scripting Programming Language
PZ02CX Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ02CX - Perl Programming Language Design and Implementation.
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 Ed Finegan. Overview of Pearl Perl is a high-level programming language written by Larry Wall. It derives from the C programming language and to.
Programming Languages Meeting 12 November 18/19, 2014.
Perl & TCL Vijay Subramanian, Modified from : perl_basics_06.ppt.
Introduction to Perl: Practical extraction and report language
PERL.
Perl Programming Language Design and Implementation (4th Edition)
Programming in Perl Introduction
Perl Variables: Array Web Programming.
Control Structures: if Conditional
An Introduction to Perl
Control Structures: for & while Loops
Programming Perls* Objective: To introduce students to the perl language. Perl is a language for getting your job done. Making Easy Things Easy & Hard.
Programming Languages
The Selection Structure
CSC 352– Unix Programming, Fall 2012
Introduction to Perl Learning Objectives:
INTRODUCTION to PERL PART 1.
LING/C SC/PSYC 438/538 Lecture 4 Sandiway Fong.
Presentation transcript:

Organization of Programming Languages Meeting 37 April 18, 2016

Planning Ahead Palindrome project due today – Submit Lisp functions in file attached to Quiz 3 on Wednesday – Scripting languages – AWK – Regular expressions More scripting, different style

PERL Practical Extraction and Support Language A glue language under Unix Written by Larry Wall See

PERL Scripting language More powerful than AWK More flexible than shell scripts Syntax derived from C Large language Later versions contain classes Many irregularities in design Many alternatives for syntax Designed to minimize keystrokes while programming

PERL Beginning assumptions and notations Statements are terminated by ; (semicolon) Comments start with # and occupy the rest of the line. – NO two-line comments Parentheses around arguments to built-in functions are optional – length(x) and length x mean the same thing

PERL First line of program is an interpreter directive, written as a special type of comment, giving the full path to the Perl interpreter #!/usr/local/bin/perl -w

Example 1 #!/usr/local/bin/perl –w print(“Hello, world!\n”);

Example 1 #!/usr/local/bin/perl –w print(“Hello, world!\n”); Inserts new line character

PERL Scalars – Integer, real, string Identifier must start with $ – scalar matches something that looks like an S, namely $

PERL Arrays – Indexed by integers Identifier must start – Array matches something that looks like A, – Indexed by strings Identifier must start with % – Hash is weird

Example 2 #!/usr/local/bin/perl –w print(“What is your name? ”); $name = ; chomp($name); print “Hello, $name!\n”;

Example 2 #!/usr/local/bin/perl –w print(“What is your name? ”); $name = ; chomp($name); print “Hello, $name!\n”; Critical space

Example 2 #!/usr/local/bin/perl –w print(“What is your name? ”); $name = ; #Reads one line chomp($name);#Cuts off EOL print “Hello, $name!\n”;

Example 2 #!/usr/local/bin/perl –w print(“What is your name? ”); $name = ; #Reads one line chomp($name);#Cuts off EOL print “Hello, $name!\n”;

PERL Control structures if-then-elsif-else foreach $element (%list) { … }

Example 3 #!/usr/local/bin/perl –w print “What is your name? ”; $name = ; chomp($name); if ($name eq “Nico”) {print “Hello, $name! Glad you’re here.\n”} elsif ($name eq “Daphne”) {print “Going outside, $name?\n”} else {print “Hello, $name.\n”};

PERL Dynamically typed – Type inferred from operations – Compare 2 < 10 (true) 2 lt 10 (false) 2 < “10” (true) “2” lt 10 (false) Numbers, strings, regular expressions Operators are not overloaded – For example, + only means add