Presentation is loading. Please wait.

Presentation is loading. Please wait.

Online Counseling Resource YCMOU ELearning Drive… School of Architecture, Science and Technology Yashwantrao Chavan Maharashtra Open University, Nashik.

Similar presentations


Presentation on theme: "Online Counseling Resource YCMOU ELearning Drive… School of Architecture, Science and Technology Yashwantrao Chavan Maharashtra Open University, Nashik."— Presentation transcript:

1 Online Counseling Resource YCMOU ELearning Drive… School of Architecture, Science and Technology Yashwantrao Chavan Maharashtra Open University, Nashik – 422222, India

2 OC-SBI083-U01-03 Introduction Programmes and Courses  SBI083-CP1_U01_03

3 School of Science and Technology, Online Counseling Resource… Credits  Academic Inputs by Sonali Alkari MSc (Botany), P.G. D.C. Bio-Informatics sonalisa_alkari@yahoo.com

4 School of Science and Technology, Online Counseling Resource… © 2007, YCMOU. All Rights Reserved.4 How to Use This Resource  Counselor at each study center should use this presentation to deliver lecture of 40-60 minutes during Face-To-Face counseling.  Discussion about students difficulties or tutorial with assignments should follow the lecture for about 40-60 minutes.  Handouts (with 6 slides on each A4 size page) of this presentation should be provided to each student.  Each student should discuss on the discussion forum all the terms which could not be understood. This will improve his writing skills and enhance knowledge level about topics, which shall be immensely useful for end exam.  Appear several times, for all the Self-Tests, available for this course.  Student can use handouts for last minutes preparation just before end exam.

5 School of Science and Technology, Online Counseling Resource… © 2007, YCMOU. All Rights Reserved.5 Learning Objectives  After studying this module, you should be able to: Write and run perl program Describe features of perl such its basis, general purpose language,Perl 5 etc.

6 School of Science and Technology, Online Counseling Resource… Introduction:1  Perl is an application.  Perl is a general-purpose programming language originally developed for text manipulation  It is available (at no cost) and runs all the operating systems found in average biology Lab (Unix, Linux, Macintosh, Windows, VMS and more)  The perl application on your computer takes a Perl language program.

7 School of Science and Technology, Online Counseling Resource… Introduction:2  Perl refers both to the language in which program is written and to the application on computers that runs those programs.  Perl needs to have a translator application (called an interpreter or compiler) that can run programs into instructions that computers can actually run.  Perl application is often referred to as perl Interpreter and it includes a perl compiler as well.

8 School of Science and Technology, Online Counseling Resource… Introduction:3  The terms program, application, Script and executable are somewhat interchangeable.  Perl is used for a wide range of tasks including system administration, web development, network programming, GUI development, and more.system administrationweb developmentnetwork programmingGUI  The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal).

9 School of Science and Technology, Online Counseling Resource… Introduction:4  Its major features include support for multiple programming paradigms (procedural, object-oriented, and functional styles), reference counting memory management (without a cycle detecting garbage collector), built-in support for text processing, and a large collection of third-party modules.proceduralobject-oriented functionalreference counting memory managementmodules

10 School of Science and Technology, Online Counseling Resource… Features of Perl:1  The overall structure of Perl derives broadly from C.  Perl is procedural in nature, with variables, expressions, assignment statements, brace- delimited code blocks, control structures, and subroutines.variables expressionsassignment statementsbracecode blockscontrol structuressubroutines  Perl also takes features from shell programming. All variables are marked with leading sigils, which unambiguously identify the data type (scalar, array, hash, etc.) of the variable in context.sigils

11 School of Science and Technology, Online Counseling Resource… Features of Perl:2  Importantly, sigils allow variables to be interpolated directly into strings.  Perl has many built-in functions which provide tools often used in shell programming (though many of these tools are implemented by programs external to the shell) like sorting, and calling on system facilities.

12 School of Science and Technology, Online Counseling Resource… Features of Perl:3  Perl takes lists from Lisp, associative arrays (hashes) from AWK, and regular expressions from sed. These simplify and facilitate many parsing, text handling, and data management tasks.listsassociative arraysregular expressions  In Perl 5, features were added that support complex data structures, first-class functions (i.e., closures as values), and an object- oriented programming model.data structuresfirst-class functionsclosures  A major additional feature introduced with Perl 5 was the ability to package code as reusable modules.

13 School of Science and Technology, Online Counseling Resource… Features of Perl:4  All versions of Perl do automatic data typing and memory management.  The interpreter knows the type and storage requirements of every data object in the program; it allocates and frees storage for them as necessary using reference counting (so it cannot deallocate circular data structures without manual intervention)reference counting

14 School of Science and Technology, Online Counseling Resource… ParadigmMulti-paradigm Appeared in1987 Designed byLarry Wall Latest release 5.10.0/ December 18, 2007, 94 days agoDecember 182007 Typing disciplineDynamic AWK AWK Influenced by, BASIC, BASIC-PLUS, C, C++, Lisp, Pascal, sed, Unix shell BASICBASIC-PLUSCC++LispPascalsedUnix shell Influenced PythonPython, PHP, Ruby, ECMAScript, DaoPHPRubyECMAScript Dao OSCross-platform License ArtisticLicense GNU General PublicLicense Features of Perl:5

15 School of Science and Technology, Online Counseling Resource… Writing and Executing a Perl Program  After installing the perl and after confirmed with system adminstation that Perl has already been installed on your system you can write your first program.  Writing and executing the Perl program involves several steps. Writing the program(or script) Saving it in a file. Running the program Reading the output.

16 School of Science and Technology, Online Counseling Resource… The Minimal Hello world ProgramHello world  In Perl, the minimal Hello world program may be written as follows:Hello world  print "Hello, world!\n" This prints the string Hello, world! and a newline, symbolically expressed by an n character whose interpretation is altered by the preceding backslash.prints stringnewline

17 School of Science and Technology, Online Counseling Resource… Canonical Form of the Program:1  #!/usr/bin/perl  print "Hello, world!\n";  The hash mark character introduces a comment in Perl, which runs up to the end of the line of code and is ignored by the compiler. comment  The comment used here is of a special kind: it’s called the shebang line.shebang

18 School of Science and Technology, Online Counseling Resource… Canonical Form of the Program:2  This tells Unix-like operating systems where to find the Perl interpreter, making it possible to invoke the program without explicitly mentioning perl.  The second line in the canonical form includes a semicolon, which is used to separate statements in Perl.

19 School of Science and Technology, Online Counseling Resource… Canonical Form of the Program:3  With only a single statement in a block or file, a separator is unnecessary, so it can be omitted from the minimal form of the program – or more generally from the final statement in any block or file.  The canonical form includes it because it is common to terminate every statement even when it is unnecessary to do so, as this makes editing easier: code can be added to or moved away from the end of a block or file without having to adjust semicolons.

20 School of Science and Technology, Online Counseling Resource… Canonical Form of the Program:4  When you invoke this program, the kernel fires up a Perl interpreter, which parses the entire program (all two lines of it, counting the first, comment line) and then executes the compiled form.  The first and only operation is the execution of the print function, which sends its arguments to the output.  After the program has completed, the Perl process exits, returning back a successful exit code to the parent shell.

21 School of Science and Technology, Online Counseling Resource… Canonical Form of the Program:5  Soon you'll see Perl programs where print and other functions are sometimes called with parentheses, other times without them.  The rule is simple: in Perl, parentheses for built-in functions are never required nor forbidden. Their use can help or hinder clarity, so use your own judgment.

22 School of Science and Technology, Online Counseling Resource… What You Learn…  You have learnt :  Details about perl applications  Uses of perl  Basis of Perl  Various features of perl  Writing and executing perl program  The canonical form of perl program

23 School of Science and Technology, Online Counseling Resource… Critical Thinking Questions 1.State Whether perl needs a interpreter or compiler to executive a program? 2.Describe in details how to write Perl program © 2007, YCMOU. All Rights Reserved.23

24 School of Science and Technology, Online Counseling Resource… Hints For Critical Thinking Question 1.Execution of perl program 2.the minimal Hello world program &Hello world The canonical form of the program © 2007, YCMOU. All Rights Reserved.24

25 School of Science and Technology, Online Counseling Resource… Study Tips:Books  Beginning Perl by Simon Cozens, Peter Wainwright. 700 pages. Wrox Press Inc. (May 25, 2000). Beginning Perl  Impatient Perl by Greg London (Feb 7, 2004). Extreme Perl by Robert Nagler Impatient Perl Extreme Perl  MacPerl: Power & Ease by Vicky Brown and Chris Nandor. 372 pages. (1998). MacPerl: Power & Ease  Picking Up Perl by Bradley M. Kuhn and Neil Smyth. self published. second edition. (July 2005). Picking Up Perl

26 School of Science and Technology, Online Counseling Resource… Study Tips:Web Resources www.en.wikipedia.org Microsoft Encarta Encyclopedia http://www.perl.org/ http://en.wikibooks.org/wiki/Programming:Perl_Websites http://cpan.perl.org/

27 School of Science and Technology, Online Counseling Resource… Community Web Sites  Planet Perl - an aggregation of selected perl journals Planet Perl  use Perl; - read community news and personal journals, or start your own journal use Perl;  Perl Monks - the wisdom of the Monks can guide you on your Perl Quests Perl Monks  perl.org - your current location perl.org  the Perl Apprenticeship Site the Perl Apprenticeship Site

28 School of Science and Technology, Online Counseling Resource… End of the Presentation Thank You


Download ppt "Online Counseling Resource YCMOU ELearning Drive… School of Architecture, Science and Technology Yashwantrao Chavan Maharashtra Open University, Nashik."

Similar presentations


Ads by Google