1. Introduction. 2. Scalar Data

Size: px
Start display at page:

Download "1. Introduction. 2. Scalar Data"

Transcription

1 1. Introduction What Does Perl Stand For? Why Did Larry Create Perl? Why Didn t Larry Just Use Some Other Language? Is Perl Easy or Hard? How Did Perl Get to Be So Popular? What s Happening with Perl Now? What s Perl Really Good For? What Is Perl Not Good For? How Can I Get Perl? What Is CPAN? How Can I Get Support for Perl? Are There Any Other Kinds of Support? What If I Find a Bug in Perl? How Do I Make a Perl Program? A Simple Program What s Inside That Program? How Do I Compile My Perl Program? 2. Scalar Data Numbers All Numbers Have the Same Format Internally Floating-Point Literals Integer Literals Nondecimal Integer Literals Numeric Operators Strings Single-Quoted String Literals Double-Quoted String Literals String Operators Automatic Conversion Between Numbers and Strings Perl s Built-in Warnings Scalar Variables Choosing Good Variable Names Scalar Assignment Binary Assignment Operators Output with print Interpolation of Scalar Variables into Strings Creating Characters by Code Point Operator Precedence and Associativity Comparison Operators The if Control Structure Boolean Values Getting User Input The chomp Operator The while Control Structure The undef Value The defined Function

2 3. Lists and Arrays Accessing Elements of an Array Special Array Indices List Literals The qw Shortcut List Assignment The pop and push Operators The shift and unshift Operators The splice Operator Interpolating Arrays into Strings The foreach Control Structure Perl s Favorite Default: $_ The reverse Operator The sort Operator The each Operator Scalar and List Context Using List-Producing Expressions in Scalar Context Using Scalar-Producing Expressions in List Context Forcing Scalar Context <STDIN> in List Context 4. Subroutines Defining a Subroutine Invoking a Subroutine Return Values Arguments Private Variables in Subroutines Variable-Length Parameter Lists A Better &max Routine Empty Parameter Lists Notes on Lexical (my) Variables The use strict Pragma The return Operator Omitting the Ampersand Non-Scalar Return Values Persistent, Private Variables 5. Input and Output Input from Standard Input Input from the Diamond Operator The Invocation Arguments Output to Standard Output Formatted Output with printf Arrays and printf Filehandles Opening a Filehandle Binmoding Filehandles Bad Filehandles

3 Closing a Filehandle Fatal Errors with die Warning Messages with warn Automatically die-ing Using Filehandles Changing the Default Output Filehandle Reopening a Standard Filehandle Output with say Filehandles in a Scalar 6. Hashes What Is a Hash? Why Use a Hash? Hash Element Access The Hash As a Whole Hash Assignment The Big Arrow Hash Functions The keys and values Functions The each Function Typical Use of a Hash The exists Function The delete Function Hash Element Interpolation The %ENV hash 7. In the World of Regular Expressions What Are Regular Expressions? Using Simple Patterns Unicode Properties About Metacharacters Simple Quantifiers Grouping in Patterns Alternatives Character Classes Character Class Shortcuts Negating the Shortcuts 8. Matching with Regular Expressions Matches with m// Match Modifiers Case-Insensitive Matching with /i Matching Any Character with /s Adding Whitespace with /x Combining Option Modifiers Choosing a Character Interpretation Other Options

4 Anchors Word Anchors The Binding Operator =~ Interpolating into Patterns The Match Variables The Persistence of Captures Noncapturing Parentheses Named Captures The Automatic Match Variables General Quantifiers Precedence Examples of Precedence And There s More A Pattern Test Program 9. Processing Text with Regular Expressions Substitutions with s/// Global Replacements with /g Different Delimiters Substitution Modifiers The Binding Operator Nondestructive Substitutions Case Shifting The split Operator The join Function m// in List Context More Powerful Regular Expressions Nongreedy Quantifiers Matching Multiple-Line Text Updating Many Files In-Place Editing from the Command Line 10. More Control Structures The unless Control Structure The else Clause with unless The until Control Structure Expression Modifiers The Naked Block Control Structure The elsif Clause Autoincrement and Autodecrement The Value of Autoincrement The for Control Structure The Secret Connection Between foreach and for Loop Controls The last Operator The next Operator The redo Operator Labeled Blocks The Conditional Operator?: Logical Operators

5 The Value of a Short Circuit Operator The defined-or Operator Control Structures Using Partial-Evaluation Operators 11. Perl Modules Finding Modules Installing Modules Using Your Own Directories Using Simple Modules The File::Basename Module Using Only Some Functions from a Module The File::Spec Module Path::Class CGI.pm Databases and DBI Dates and Times 12. File Tests File Test Operators Testing Several Attributes of the Same File Stacked File Test Operators The stat and lstat Functions The localtime Function Bitwise Operators Using Bitstrings 13. Directory Operations Moving Around the Directory Tree Globbing An Alternate Syntax for Globbing Directory Handles Recursive Directory Listing Manipulating Files and Directories Removing Files Renaming Files Links and Files Making and Removing Directories Modifying Permissions Changing Ownership Changing Timestamps 14. Strings and Sorting Finding a Substring with index Manipulating a Substring with substr Formatting Data with sprintf Using sprintf with Money Numbers Interpreting Non-Decimal Numerals

6 Advanced Sorting Sorting a Hash by Value Sorting by Multiple Keys 15. Smart Matching and given-when The Smart Match Operator Smart Match Precedence The given Statement Dumb Matching Using when with Many Items 16. Process Management The system Function Avoiding the Shell The Environment Variables The exec Function Using Backquotes to Capture Output Using Backquotes in a List Context External Processes with IPC::System::Simple Processes as Filehandles Getting Down and Dirty with Fork Sending and Receiving Signals Slices Array Slice Hash Slice Trapping Errors Using eval More Advanced Error Handling autodie Picking Items from a List with grep Transforming Items from a List with map Fancier List Utilities

PERL Scripting - Course Contents

PERL Scripting - Course Contents PERL Scripting - Course Contents Day - 1 Introduction to PERL Comments Reading from Standard Input Writing to Standard Output Scalar Variables Numbers and Strings Use of Single Quotes and Double Quotes

More information

Perl Scripting. Students Will Learn. Course Description. Duration: 4 Days. Price: $2295

Perl Scripting. Students Will Learn. Course Description. Duration: 4 Days. Price: $2295 Perl Scripting Duration: 4 Days Price: $2295 Discounts: We offer multiple discount options. Click here for more info. Delivery Options: Attend face-to-face in the classroom, remote-live or on-demand streaming.

More information

Beginning Perl. Third Edition. Apress. JAMES LEE with SIMON COZENS

Beginning Perl. Third Edition. Apress. JAMES LEE with SIMON COZENS Beginning Perl Third Edition JAMES LEE with SIMON COZENS Apress About the Author... About the Technical Reviewers Acknowledgements Suitrod yetion «. xvi xvii xviii «xix. Chapter 1: First Steps in Perl..

More information

Perl. Interview Questions and Answers

Perl. Interview Questions and Answers and Answers Prepared by Abhisek Vyas Document Version 1.0 Team, www.sybaseblog.com 1 of 13 Q. How do you separate executable statements in perl? semi-colons separate executable statements Example: my(

More information

UNIX Shell Programming

UNIX Shell Programming $!... 5:13 $$ and $!... 5:13.profile File... 7:4 /etc/bashrc... 10:13 /etc/profile... 10:12 /etc/profile File... 7:5 ~/.bash_login... 10:15 ~/.bash_logout... 10:18 ~/.bash_profile... 10:14 ~/.bashrc...

More information

Hands-On Perl Scripting and CGI Programming

Hands-On Perl Scripting and CGI Programming Hands-On Course Description This hands on Perl programming course provides a thorough introduction to the Perl programming language, teaching attendees how to develop and maintain portable scripts useful

More information

Pathologically Eclectic Rubbish Lister

Pathologically Eclectic Rubbish Lister Pathologically Eclectic Rubbish Lister 1 Perl Design Philosophy Author: Reuben Francis Cornel perl is an acronym for Practical Extraction and Report Language. But I guess the title is a rough translation

More information

CSCI-GA Scripting Languages

CSCI-GA Scripting Languages CSCI-GA.3033.003 Scripting Languages 9/11/2013 Textual data processing (Perl) 1 Announcements If you did not get a PIN to enroll, contact Stephanie Meik 2 Outline Perl Basics (continued) Regular Expressions

More information

They grow as needed, and may be made to shrink. Officially, a Perl array is a variable whose value is a list.

They grow as needed, and may be made to shrink. Officially, a Perl array is a variable whose value is a list. Arrays Perl arrays store lists of scalar values, which may be of different types. They grow as needed, and may be made to shrink. Officially, a Perl array is a variable whose value is a list. A list literal

More information

What is PERL?

What is PERL? Perl For Beginners What is PERL? Practical Extraction Reporting Language General-purpose programming language Creation of Larry Wall 1987 Maintained by a community of developers Free/Open Source www.cpan.org

More information

CSCI 4152/6509 Natural Language Processing. Perl Tutorial CSCI 4152/6509. CSCI 4152/6509, Perl Tutorial 1

CSCI 4152/6509 Natural Language Processing. Perl Tutorial CSCI 4152/6509. CSCI 4152/6509, Perl Tutorial 1 CSCI 4152/6509 Natural Language Processing Perl Tutorial CSCI 4152/6509 Vlado Kešelj CSCI 4152/6509, Perl Tutorial 1 created in 1987 by Larry Wall About Perl interpreted language, with just-in-time semi-compilation

More information

COMS 3101 Programming Languages: Perl. Lecture 2

COMS 3101 Programming Languages: Perl. Lecture 2 COMS 3101 Programming Languages: Perl Lecture 2 Fall 2013 Instructor: Ilia Vovsha http://www.cs.columbia.edu/~vovsha/coms3101/perl Lecture Outline Control Flow (continued) Input / Output Subroutines Concepts:

More information

Scripting Languages Perl Basics. Course: Hebrew University

Scripting Languages Perl Basics. Course: Hebrew University Scripting Languages Perl Basics Course: 67557 Hebrew University אליוט יפה Jaffe Lecturer: Elliot FMTEYEWTK Far More Than Everything You've Ever Wanted to Know Perl Pathologically Eclectic Rubbish Lister

More information

8/13/ /printqp.php?heading=II BSc [ ], Semester III, Allied: COMPUTER PROGRAMMING-PERL -309C&qname=309C

8/13/ /printqp.php?heading=II BSc [ ], Semester III, Allied: COMPUTER PROGRAMMING-PERL -309C&qname=309C Dr.G.R.Damodaran College of Science (Autonomous, affiliated to the Bharathiar University, recognized by the UGC)Reaccredited at the 'A' Grade Level by the NAAC and ISO 9001:2008 Certified CRISL rated 'A'

More information

Introduction to Perl. Perl Background. Sept 24, 2007 Class Meeting 6

Introduction to Perl. Perl Background. Sept 24, 2007 Class Meeting 6 Introduction to Perl Sept 24, 2007 Class Meeting 6 * Notes on Perl by Lenwood Heath, Virginia Tech 2004 Perl Background Practical Extraction and Report Language (Perl) Created by Larry Wall, mid-1980's

More information

Outline. CS3157: Advanced Programming. Feedback from last class. Last plug

Outline. CS3157: Advanced Programming. Feedback from last class. Last plug Outline CS3157: Advanced Programming Lecture #2 Jan 23 Shlomo Hershkop shlomo@cs.columbia.edu Feedback Introduction to Perl review and continued Intro to Regular expressions Reading Programming Perl pg

More information

IT441. Network Services Administration. Data Structures: Arrays

IT441. Network Services Administration. Data Structures: Arrays IT441 Network Services Administration Data Structures: Arrays Data Types Remember there are three basic data types in Perl o Numeric o String o Boolean (Logical) I differentiate between data types and

More information

Perl Tutorial. Diana Inkpen. School of Information Technology and Engineering University of Ottawa. CSI 5180, Fall 2004

Perl Tutorial. Diana Inkpen. School of Information Technology and Engineering University of Ottawa. CSI 5180, Fall 2004 Perl Tutorial Diana Inkpen School of Information Technology and Engineering University of Ottawa CSI 5180, Fall 2004 1 What is Perl Practical Extraction and Report Language. Created, implemented, maintained

More information

autodie - Replace functions with ones that succeed or die with lexical scope # Recommended: implies 'use autodie qw(:default)'

autodie - Replace functions with ones that succeed or die with lexical scope # Recommended: implies 'use autodie qw(:default)' NAME autodie - Replace functions with ones that succeed or die with lexical scope SYNOPSIS # Recommended: implies 'use autodie qw(:default)' use autodie qw(:all); # Recommended more: defaults and system/exec.

More information

Perl Library Functions

Perl Library Functions Perl Library Functions Perl has literally hundreds of functions for all kinds of purposes: file manipulation, database access, network programming, etc. etc. It has an especially rich collection of functions

More information

COMS 3101 Programming Languages: Perl. Lecture 1

COMS 3101 Programming Languages: Perl. Lecture 1 COMS 3101 Programming Languages: Perl Lecture 1 Fall 2013 Instructor: Ilia Vovsha http://www.cs.columbia.edu/~vovsha/coms3101/perl What is Perl? Perl is a high level language initially developed as a scripting

More information

More Perl. CS174 Chris Pollett Oct 25, 2006.

More Perl. CS174 Chris Pollett Oct 25, 2006. More Perl CS174 Chris Pollett Oct 25, 2006. Outline Loops Arrays Hashes Functions Selection Redux Last day we learned about how if-else works in Perl. Perl does not have a switch statement Like Javascript,

More information

CMSC 331 Final Exam Fall 2013

CMSC 331 Final Exam Fall 2013 CMSC 331 Final Exam Fall 2013 Name: UMBC username: You have two hours to complete this closed book exam. Use the backs of these pages if you need more room for your answers. Describe any assumptions you

More information

Perl and Python ESA 2007/2008. Eelco Schatborn 27 September 2007

Perl and Python ESA 2007/2008. Eelco Schatborn 27 September 2007 Perl and Python ESA 2007/2008 Eelco Schatborn eelco@os3.nl 27 September 2007 ESA: Perl Vandaag: 1. Perl introduction 2. Basic Perl: types, variables, statements,... 3. Object Oriented Perl 4. Documentation

More information

CP150 - Advanced Perl Programming

CP150 - Advanced Perl Programming Corder Enterprises International Building World Class MIS Teams, for you! CP150 - Advanced Perl Programming Course Description: Perl has evolved from its beginnings as an eclectic scripting tool for UNIX

More information

9.1 Origins and Uses of Perl

9.1 Origins and Uses of Perl 9.1 Origins and Uses of Perl - Began in the late 1980s as a more powerful replacement for the capabilities of awk (text file processing) and sh (UNIX system administration) - Now includes sockets for communications

More information

Perl (5 Days Content)

Perl (5 Days Content) Perl (5 Days Content) Pre-requisites: Knowledge of any programming language ( C / C++ / Shell Scripting) Objective of the Course: The participants should be in a position to understand Perl Scripts written

More information

SIXTH EDITION. Learning Perl. Randal L. Schwartz, brian d foy, and Tom Phoenix. Beijing Cambridge Farnham Köln Sebastopol Tokyo

SIXTH EDITION. Learning Perl. Randal L. Schwartz, brian d foy, and Tom Phoenix. Beijing Cambridge Farnham Köln Sebastopol Tokyo Learning Perl SIXTH EDITION Learning Perl Randal L. Schwartz, brian d foy, and Tom Phoenix Beijing Cambridge Farnham Köln Sebastopol Tokyo Learning Perl, Sixth Edition by Randal L. Schwartz, brian d foy,

More information

package YourModule; require = = qw(munge frobnicate); # symbols to export on request

package YourModule; require = = qw(munge frobnicate); # symbols to export on request NAME SYNOPSIS Exporter - Implements default import method for modules In module YourModule.pm: require Exporter; @EXPORT_OK = qw(munge frobnicate); # symbols to export on request or use Exporter 'import';

More information

15.1 Origins and Uses of Ruby

15.1 Origins and Uses of Ruby 15.1 Origins and Uses of Ruby - Designed by Yukihiro Matsumoto; released in 1996 - Use spread rapidly in Japan - Use is now growing in part because of its use in Rails - A pure object-oriented purely interpreted

More information

Lecture 2: Programming in Perl: Introduction 1

Lecture 2: Programming in Perl: Introduction 1 Lecture 2: Programming in Perl: Introduction 1 Torgeir R. Hvidsten Professor Norwegian University of Life Sciences Guest lecturer Umeå Plant Science Centre Computational Life Science Cluster (CLiC) 1 This

More information

COMP284 Scripting Languages Lecture 3: Perl (Part 2) Handouts

COMP284 Scripting Languages Lecture 3: Perl (Part 2) Handouts COMP284 Scripting Languages Lecture 3: Perl (Part 2) Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University of Liverpool

More information

Perl Basics 7 Mar 2009 #fedora-classroom. Doran Barton

Perl Basics 7 Mar 2009 #fedora-classroom. Doran Barton Perl Basics 7 Mar 2009 #fedora-classroom Doran Barton 1 LEARNING RESOURCES Books Learning Perl (Llama book) Programming Perl (Camel book) A whole bunch of other O'Reilly books Perl

More information

Graham Kemp (telephone , room 6475 EDIT) The examiner will visit the exam room at 09:30 and 11:30.

Graham Kemp (telephone , room 6475 EDIT) The examiner will visit the exam room at 09:30 and 11:30. CHALMERS UNIVERSITY OF TECHNOLOGY Examination in Bioinformatics, MVE360 Monday 14 March 2016, 08:30-12:30 Examiner: Results: Exam review: Grades: Help material: Graham Kemp (telephone 772 54 11, room 6475

More information

Client-Side Web Technologies. JavaScript Part I

Client-Side Web Technologies. JavaScript Part I Client-Side Web Technologies JavaScript Part I JavaScript First appeared in 1996 in Netscape Navigator Main purpose was to handle input validation that was currently being done server-side Now a powerful

More information

perl -MO=Deparse[,-d][,-fFILE][,-p][,-q][,-l] [,-sletters][,-xlevel] prog.pl

perl -MO=Deparse[,-d][,-fFILE][,-p][,-q][,-l] [,-sletters][,-xlevel] prog.pl NAME SYNOPSIS DESCRIPTION OPTIONS B::Deparse - Perl compiler backend to produce perl code perl -MO=Deparse[,-d][,-fFILE][,-p][,-q][,-l] [,-sletters][,-xlevel] prog.pl B::Deparse is a backend module for

More information

CS 105 Perl: Completing the Toolbox

CS 105 Perl: Completing the Toolbox CS 105 Perl: Completing the Toolbox March 4, 2013 Agenda autodie with open Inspecting scalars perl -c Unary coercion Topicalization ~~ Unique list idiom Schwartzian Transform Using // for defaults and

More information

Introduction to Perl. c Sanjiv K. Bhatia. Department of Mathematics & Computer Science University of Missouri St. Louis St.

Introduction to Perl. c Sanjiv K. Bhatia. Department of Mathematics & Computer Science University of Missouri St. Louis St. Introduction to Perl c Sanjiv K. Bhatia Department of Mathematics & Computer Science University of Missouri St. Louis St. Louis, MO 63121 Contents 1 Introduction 1 2 Getting started 1 3 Writing Perl scripts

More information

@EXPORT_OK = qw(munge frobnicate); # symbols to export on request

@EXPORT_OK = qw(munge frobnicate); # symbols to export on request NAME Exporter - Implements default import method for modules SYNOPSIS In module YourModule.pm: package YourModule; require Exporter; @ISA = qw(exporter); @EXPORT_OK = qw(munge frobnicate); # symbols to

More information

Welcome to Research Computing Services training week! November 14-17, 2011

Welcome to Research Computing Services training week! November 14-17, 2011 Welcome to Research Computing Services training week! November 14-17, 2011 Monday intro to Perl, Python and R Tuesday learn to use Titan Wednesday GPU, MPI and profiling Thursday about RCS and services

More information

T-( )-MALV, Natural Language Processing The programming language Perl

T-( )-MALV, Natural Language Processing The programming language Perl T-(538 725)-MALV, Natural Language Processing The programming language Perl Hrafn Loftsson 1 Hannes Högni Vilhjálmsson 1 1 School of Computer Science, Reykjavik University September 2010 Outline 1 Perl

More information

Regular expressions and case insensitivity

Regular expressions and case insensitivity Regular expressions and case insensitivity As previously mentioned, you can make matching case insensitive with the i flag: /\b[uu][nn][ii][xx]\b/; /\bunix\b/i; # explicitly giving case folding # using

More information

Classnote for COMS6100

Classnote for COMS6100 Classnote for COMS6100 Yiting Wang 3 November, 2016 Today we learn about subroutines, references, anonymous and file I/O in Perl. 1 Subroutines in Perl First of all, we review the subroutines that we had

More information

5th State of the Onion. Larry Wall

5th State of the Onion. Larry Wall 5th State of the Onion Larry Wall Talk 1 An Overview of Perl Perl 5 Perl 6 Talk 2 Bits and Pieces 33 lightning talks in half an hour See Apocalypse 2 Expected apocalyptic error rate: 5% Talk 3 Unary and

More information

Learning Perl 6. brian d foy, Version 0.6, Nordic Perl Workshop 2007

Learning Perl 6. brian d foy, Version 0.6, Nordic Perl Workshop 2007 Learning Perl 6 brian d foy, Version 0.6, Nordic Perl Workshop 2007 for the purposes of this tutorial Perl 5 never existed Don t really do this $ ln -s /usr/local/bin/pugs /usr/bin/perl

More information

A Crash Course in Perl5

A Crash Course in Perl5 z e e g e e s o f t w a r e A Crash Course in Perl5 Part 1: Basics Zeegee Software Inc. http://www.zeegee.com/ Terms and Conditions These slides are Copyright 2008 by Zeegee Software Inc. They have been

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

Indian Institute of Technology Kharagpur. PERL Part III. Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. I.I.T.

Indian Institute of Technology Kharagpur. PERL Part III. Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. I.I.T. Indian Institute of Technology Kharagpur PERL Part III Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. I.I.T. Kharagpur, INDIA Lecture 23: PERL Part III On completion, the student will be able

More information

CSCI-GA Scripting Languages

CSCI-GA Scripting Languages CSCI-GA.3033.003 Scripting Languages 6/7/2012 Textual data processing (Perl) CS 5142 Cornell University 9/7/13 1 Administrative Announcements Homework 2 due Friday at 6pm. First prelim 9/27, Review on

More information

JavaScript. History. Adding JavaScript to a page. CS144: Web Applications

JavaScript. History. Adding JavaScript to a page. CS144: Web Applications JavaScript Started as a simple script in a Web page that is interpreted and run by the browser Supported by most modern browsers Allows dynamic update of a web page More generally, allows running an arbitrary

More information

CS 105 Perl: File I/O, slices, and array manipulation

CS 105 Perl: File I/O, slices, and array manipulation CS 105 Perl: File I/O, slices, and array manipulation Nathan Clement January 27, 2013! Agenda Intermediate iteration last and next Intermediate I/O Special variables Array manipulation push, pop, shift,

More information

(Refer Slide Time: 01:12)

(Refer Slide Time: 01:12) Internet Technology Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No #22 PERL Part II We continue with our discussion on the Perl

More information

JavaScript. History. Adding JavaScript to a page. CS144: Web Applications

JavaScript. History. Adding JavaScript to a page. CS144: Web Applications JavaScript Started as a simple script in a Web page that is interpreted and run by the browser Supported by most modern browsers Allows dynamic update of a web page More generally, allows running an arbitrary

More information

Bioinformatics. Computational Methods II: Sequence Analysis with Perl. George Bell WIBR Biocomputing Group

Bioinformatics. Computational Methods II: Sequence Analysis with Perl. George Bell WIBR Biocomputing Group Bioinformatics Computational Methods II: Sequence Analysis with Perl George Bell WIBR Biocomputing Group Sequence Analysis with Perl Introduction Input/output Variables Functions Control structures Arrays

More information

Perl. Perl. Perl. Which Perl

Perl. Perl. Perl. Which Perl Perl Perl Perl = Practical Extraction and Report Language Developed by Larry Wall (late 80 s) as a replacement for awk. Has grown to become a replacement for awk, sed, grep, other filters, shell scripts,

More information

COMP284 Scripting Languages Lecture 2: Perl (Part 1) Handouts

COMP284 Scripting Languages Lecture 2: Perl (Part 1) Handouts COMP284 Scripting Languages Lecture 2: Perl (Part 1) Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University of Liverpool

More information

Perl. Many of these conflict with design principles of languages for teaching.

Perl. Many of these conflict with design principles of languages for teaching. Perl Perl = Practical Extraction and Report Language Developed by Larry Wall (late 80 s) as a replacement for awk. Has grown to become a replacement for awk, sed, grep, other filters, shell scripts, C

More information

Learning Perl Objects, References, and Modules

Learning Perl Objects, References, and Modules Learning Perl Objects, References, and Modules Randal L. Schwartz with Tom Phoenix HLuHB Darmstadt Illlllllllllllllllllllll 15760214 O'REILLY* Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo

More information

GNU ccscript Scripting Guide IV

GNU ccscript Scripting Guide IV GNU ccscript Scripting Guide IV David Sugar GNU Telephony 2008-08-20 (The text was slightly edited in 2017.) Contents 1 Introduction 1 2 Script file layout 2 3 Statements and syntax 4 4 Loops and conditionals

More information

By default, optional warnings are disabled, so any legacy code that doesn't attempt to control the warnings will work unchanged.

By default, optional warnings are disabled, so any legacy code that doesn't attempt to control the warnings will work unchanged. SYNOPSIS use warnings; no warnings; use warnings "all"; no warnings "all"; use warnings::register; if (warnings::enabled()) warnings::warn("some warning"); if (warnings::enabled("void")) warnings::warn("void",

More information

CERTIFICATE IN WEB PROGRAMMING

CERTIFICATE IN WEB PROGRAMMING COURSE DURATION: 6 MONTHS CONTENTS : CERTIFICATE IN WEB PROGRAMMING 1. PROGRAMMING IN C and C++ Language 2. HTML/CSS and JavaScript 3. PHP and MySQL 4. Project on Development of Web Application 1. PROGRAMMING

More information

Bashed One Too Many Times. Features of the Bash Shell St. Louis Unix Users Group Jeff Muse, Jan 14, 2009

Bashed One Too Many Times. Features of the Bash Shell St. Louis Unix Users Group Jeff Muse, Jan 14, 2009 Bashed One Too Many Times Features of the Bash Shell St. Louis Unix Users Group Jeff Muse, Jan 14, 2009 What is a Shell? The shell interprets commands and executes them It provides you with an environment

More information

IT441. Subroutines. (a.k.a., Functions, Methods, etc.) DRAFT. Network Services Administration

IT441. Subroutines. (a.k.a., Functions, Methods, etc.) DRAFT. Network Services Administration IT441 Network Services Administration Subroutines DRAFT (a.k.a., Functions, Methods, etc.) Organizing Code We have recently discussed the topic of organizing data (i.e., arrays and hashes) in order to

More information

The SPL Programming Language Reference Manual

The SPL Programming Language Reference Manual The SPL Programming Language Reference Manual Leonidas Fegaras University of Texas at Arlington Arlington, TX 76019 fegaras@cse.uta.edu February 27, 2018 1 Introduction The SPL language is a Small Programming

More information

Fortunately, the layout is much more legible, more like BASIC's PRINT USING statement. Think of it as a poor man's nroff(1). nroff

Fortunately, the layout is much more legible, more like BASIC's PRINT USING statement. Think of it as a poor man's nroff(1). nroff NAME DESCRIPTION perlform - Perl formats Perl has a mechanism to help you generate simple reports and charts To facilitate this, Perl helps you code up your output page close to how it will look when it's

More information

Tieing and Overloading Objects in Perl. Dave Cross Magnum Solutions

Tieing and Overloading Objects in Perl. Dave Cross Magnum Solutions Tieing and Overloading Objects in Perl Dave Cross Magnum Solutions What We Will Cover Why tie or overload? What We Will Cover Why tie or overload? Tieing objects What We Will Cover Why tie or overload?

More information

Indian Institute of Technology Kharagpur. PERL Part II. Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. I.I.T.

Indian Institute of Technology Kharagpur. PERL Part II. Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. I.I.T. Indian Institute of Technology Kharagpur PERL Part II Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. I.I.T. Kharagpur, INDIA Lecture 22: PERL Part II On completion, the student will be able

More information

Language Reference Manual simplicity

Language Reference Manual simplicity Language Reference Manual simplicity Course: COMS S4115 Professor: Dr. Stephen Edwards TA: Graham Gobieski Date: July 20, 2016 Group members Rui Gu rg2970 Adam Hadar anh2130 Zachary Moffitt znm2104 Suzanna

More information

use File::Find; find({ wanted => \&process, follow => 1 }, '.');

use File::Find; find({ wanted => \&process, follow => 1 }, '.'); NAME SYNOPSIS File::Find - Traverse a directory tree. find(\&wanted, @directories_to_search); sub wanted {... } finddepth(\&wanted, @directories_to_search); sub wanted {... } DESCRIPTION find({ wanted

More information

Babu Madhav Institute of Information Technology, UTU 2015

Babu Madhav Institute of Information Technology, UTU 2015 Five years Integrated M.Sc.(IT)(Semester 5) Question Bank 060010502:Programming in Python Unit-1:Introduction To Python Q-1 Answer the following Questions in short. 1. Which operator is used for slicing?

More information

COMP284 Scripting Languages Lecture 6: Perl (Part 5) Handouts

COMP284 Scripting Languages Lecture 6: Perl (Part 5) Handouts COMP284 Scripting Languages Lecture 6: Perl (Part 5) Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University of Liverpool

More information

Now applying :unique to lexical variables and to subroutines will result in a compilation error.

Now applying :unique to lexical variables and to subroutines will result in a compilation error. NAME DESCRIPTION perl591delta - what is new for perl v5.9.1 This document describes differences between the 5.9.0 and the 5.9.1 development releases. See perl590delta for the differences between 5.8.0

More information

perl -MO=Deparse[,-d][,-fFILE][,-p][,-q][,-l] [,-sletters][,-xlevel] prog.pl

perl -MO=Deparse[,-d][,-fFILE][,-p][,-q][,-l] [,-sletters][,-xlevel] prog.pl NAME SYNOPSIS DESCRIPTION OPTIONS B::Deparse - Perl compiler backend to produce perl code perl -MO=Deparse[,-d][,-fFILE][,-p][,-q][,-l] [,-sletters][,-xlevel] prog.pl B::Deparse is a backend module for

More information

Examples of Using the ARGV Array. Loop Control Operators. Next Operator. Last Operator. Perl has three loop control operators.

Examples of Using the ARGV Array. Loop Control Operators. Next Operator. Last Operator. Perl has three loop control operators. Examples of Using the ARGV Array # mimics the Unix echo utility foreach (@ARGV) { print $_ ; print \n ; # count the number of command line arguments $i = 0; foreach (@ARGV) { $i++; print The number of

More information

30-Jan CSCI 4152/6509 Natural Language Processing Lab 4: Perl Tutorial 3. Perl Tutorial 3. Faculty of Computer Science, Dalhousie University

30-Jan CSCI 4152/6509 Natural Language Processing Lab 4: Perl Tutorial 3. Perl Tutorial 3. Faculty of Computer Science, Dalhousie University Lecture 4 p.1 Faculty of Computer Science, Dalhousie University CSCI 4152/6509 Natural Language Processing Lab 4: Perl Tutorial 3 30-Jan-2019 Lab Instructor: Dijana Kosmajac, Afsan Gujarati, and Yuhan

More information

Regular expressions and case insensitivity

Regular expressions and case insensitivity Regular expressions and case insensitivity As previously mentioned, you can make matching case insensitive with the i flag: /\b[uu][nn][ii][xx]\b/; # explicitly giving case folding /\bunix\b/i; # using

More information

Model Question Paper. Credits: 4 Marks: 140

Model Question Paper. Credits: 4 Marks: 140 Model Question Paper Subject Code: BT0075 Subject Name: RDBMS and MySQL Credits: 4 Marks: 140 Part A (One mark questions) 1. MySQL Server works in A. client/server B. specification gap embedded systems

More information

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 11 Introduction to PHP

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 11 Introduction to PHP Chapter 11 Introduction to PHP 11.1 Origin and Uses of PHP Developed by Rasmus Lerdorf in 1994 PHP is a server-side scripting language, embedded in XHTML pages PHP has good support for form processing

More information

Expr Language Reference

Expr Language Reference Expr Language Reference Expr language defines expressions, which are evaluated in the context of an item in some structure. This article describes the syntax of the language and the rules that govern the

More information

IT441. Network Services Administration. Perl: File Handles

IT441. Network Services Administration. Perl: File Handles IT441 Network Services Administration Perl: File Handles Comment Blocks Perl normally treats lines beginning with a # as a comment. Get in the habit of including comments with your code. Put a comment

More information

Bamuengine.com. Chapter 14. Perl The Mater Manipulator

Bamuengine.com. Chapter 14. Perl The Mater Manipulator Chapter 14. Perl The Mater Manipulator Introduciton The following sections tell you what Perl is, the variables and operators in perl, the string handling functions. The chapter also discusses file handling

More information

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines.

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines. Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

PERL - FUNCTIONS REFERENCES

PERL - FUNCTIONS REFERENCES PERL - FUNCTIONS REFERENCES http://www.tutorialspoint.com/perl/perl_function_references.htm Copyright tutorialspoint.com Here is the list of all the important functions supported by standard Perl. abs

More information

CS 230 Programming Languages

CS 230 Programming Languages CS 230 Programming Languages 09 / 16 / 2013 Instructor: Michael Eckmann Today s Topics Questions/comments? Continue Syntax & Semantics Mini-pascal Attribute Grammars More Perl A more complex grammar Let's

More information

Modularity and Reusability I. Functions and code reuse

Modularity and Reusability I. Functions and code reuse Modularity and Reusability I Functions and code reuse Copyright 2006 2009 Stewart Weiss On being efficient When you realize that a piece of Perl code that you wrote may be useful in future programs, you

More information

Beginning Perl. Mark Senn. September 11, 2007

Beginning Perl. Mark Senn. September 11, 2007 GoBack Beginning Perl Mark Senn September 11, 2007 Overview Perl is a popular programming language used to write systen software, text processing tools, World Wide Web CGI programs, etc. It was written

More information

The PCAT Programming Language Reference Manual

The PCAT Programming Language Reference Manual The PCAT Programming Language Reference Manual Andrew Tolmach and Jingke Li Dept. of Computer Science Portland State University September 27, 1995 (revised October 15, 2002) 1 Introduction The PCAT language

More information

CSCI-GA Scripting Languages

CSCI-GA Scripting Languages CSCI-GA.3033.003 Scripting Languages 9/20/2013 Context and Modules (Perl) Scripting as Glue 1 Outline Programming in the large Scripting as glue 2 Modules Module = file p/q.pm that starts with declaration

More information

Ruby: Introduction, Basics

Ruby: Introduction, Basics Ruby: Introduction, Basics Computer Science and Engineering College of Engineering The Ohio State University Lecture 4 Ruby vs Java: Similarities Imperative and object-oriented Classes and instances (ie

More information

ADVANTAGES. Via PL/SQL, all sorts of calculations can be done quickly and efficiently without use of Oracle engine.

ADVANTAGES. Via PL/SQL, all sorts of calculations can be done quickly and efficiently without use of Oracle engine. 1 PL/SQL INTRODUCTION SQL does not have procedural capabilities. SQL does not provide the programming techniques of condition checking, looping and branching that is required for data before permanent

More information

... and run the script as /path/to/script.pl. Of course, it'll need to be executable first, so chmod 755 script.pl (under Unix).

... and run the script as /path/to/script.pl. Of course, it'll need to be executable first, so chmod 755 script.pl (under Unix). NAME DESCRIPTION What is Perl? perlintro -- a brief introduction and overview of Perl This document is intended to give you a quick overview of the Perl programming language, along with pointers to further

More information

CS 5142 Scripting Languages

CS 5142 Scripting Languages CS 5142 Scripting Languages 10/25/2012 Ruby 1 Outline Ruby Martin Hirzel 2 About Ruby Invented 1995 by Yokihiro Matz Matsumoto Influenced by SmallTalk Everything is an object (even e.g., integers) Blocks

More information

Review of Fundamentals

Review of Fundamentals Review of Fundamentals 1 The shell vi General shell review 2 http://teaching.idallen.com/cst8207/14f/notes/120_shell_basics.html The shell is a program that is executed for us automatically when we log

More information

Outline. Introduction to Perl. Why use scripting languages? What is expressiveness. Why use Java over C

Outline. Introduction to Perl. Why use scripting languages? What is expressiveness. Why use Java over C Outline Introduction to Perl Grégory Mounié Scripting Languages Perl 2012-10-11 jeu. Basics Advanced 1 / 30 2 / 30 Why use scripting languages? What is expressiveness Why use Java over C Memory management

More information

The Power of Perl. Perl. Perl. Change all gopher to World Wide Web in a single command

The Power of Perl. Perl. Perl. Change all gopher to World Wide Web in a single command The Power of Perl Perl Change all gopher to World Wide Web in a single command perl -e s/gopher/world Wide Web/gi -p -i.bak *.html Perl can be used as a command Or like an interpreter UVic SEng 265 Daniel

More information

Perl Regular Expressions. Perl Patterns. Character Class Shortcuts. Examples of Perl Patterns

Perl Regular Expressions. Perl Patterns. Character Class Shortcuts. Examples of Perl Patterns Perl Regular Expressions Unlike most programming languages, Perl has builtin support for matching strings using regular expressions called patterns, which are similar to the regular expressions used in

More information

COMS 3101 Programming Languages: Perl. Lecture 5

COMS 3101 Programming Languages: Perl. Lecture 5 COMS 3101 Programming Languages: Perl Lecture 5 Fall 2013 Instructor: Ilia Vovsha http://www.cs.columbia.edu/~vovsha/coms3101/perl Lecture Outline Packages & Modules Concepts: Subroutine references Symbolic

More information

Essentials for Scientific Computing: Stream editing with sed and awk

Essentials for Scientific Computing: Stream editing with sed and awk Essentials for Scientific Computing: Stream editing with sed and awk Ershaad Ahamed TUE-CMS, JNCASR May 2012 1 Stream Editing sed and awk are stream processing commands. What this means is that they are

More information

Functional Programming. Pure Functional Programming

Functional Programming. Pure Functional Programming Functional Programming Pure Functional Programming Computation is largely performed by applying functions to values. The value of an expression depends only on the values of its sub-expressions (if any).

More information

Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and

Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and #include The Use of printf() and scanf() The Use of printf()

More information