Scripting Languages [R17a0532] Lecture Notes
Total Page:16
File Type:pdf, Size:1020Kb
SCRIPTING LANGUAGES [R17A0532] LECTURE NOTES B.TECH IV YEAR – I SEM (R17) (2020-2021) MALLA REDDY COLLEGE OF ENGINEERING & TECHNOLOGY (Autonomous Institution – UGC, Govt. of India) Recognized under 2(f) and 12 (B) of UGC ACT 1956 (Affiliated to JNTUH, Hyderabad, Approved by AICTE - Accredited by NBA & NAAC – ‘A’ Grade - ISO 9001:2015 Certified) Maisammaguda, Dhulapally (Post Via. Hakimpet), Secunderabad – 500100, Telangana State, India 1 MALLA REDDY COLLEGE OF ENGINEERING & TECHNOLOGY IV Year B. Tech CSE ‐ I Sem L T/P/D C 3 -/-/- 3 (R17A0532) Scripting Languages Objectives: The course demonstrates an in depth understanding of the tools and the scripting languages The main objective of this advanced course is assisting Perl programmer or database administrator to compile large programming set. Other tasks include implementing complex data structure, compiling object-orientedprogramming. Incorporate PHP into HTML files, Write basic PHP scripts, Process form input, Write and use functions. The advanced PHP training course further develops the skills of experienced PHP Programmers by introducing them to advanced techniques, tools, and methodologies that can be used to build complex, scalable, PHPapplications. The goal of this course is to teach students the skills required to write Taylor Control Language (TCL) sequences using fundamental and advanced languagefeatures. UNIT I Introduction to PERL and Scripting Scripts and Programs, Origin of Scripting , Scripting Today, Characteristics of Scripting Languages. Web Scripting, and the universe of Scripting Languages. PERL-Names and Values, Variables, Scalar Expressions, Control Structures, arrays, list, hashes, strings, pattern and regular expressions, subroutines, advance perl -finer points of looping, pack and unpack, file system, eval, data structures, packages, modules, objects, interfacing to the operating system, Creating Internet ware applications, Dirty Hands Internet Programming, securityIssues. UNIT II PHP Basics PHP Basics - Features, Embedding PHP Code in your Web pages, Outputting the data to the browser, Datatypes, Variables, Constants, expressions, string interpolation, control structures, Function, Creating a Function, Function Libraries, Arrays, strings and Regular Expressions. UNIT III Advanced PHP Programming Php and Web Forms, Files, PHP Authentication and Methodologies-Hard Coded, File Based, Database Based, IP Based, Login Administration, Uploading Files with PHP, Sending Email using PHP, PHP Encryption Functions, the Mcrypt package, Building Web sites for the World. UNIT IV TCL TCL Structure, syntax, Variables and Data in TCL, Control Flow, Data Structures, 2 input/output, procedures , strings , patterns, files, Advance TCL-eval, source, exec and up level commands, Name spaces, trapping errors, event driven programs, making applications internet aware, Nuts and Bolts Internet Programming, Security Issues, C Interface. Tk-Visual Tool Kits, Fundamental Concepts of Tk, Tk by example, Events and Binding,Perl-Tk. UNITV Python Introduction to Python language, python-syntax, statements, functions, Built-in-functions and Methods, Modules in python, Exception Handling, Integrated Web Applications in Python – Building Small, Efficient Python Web Systems ,Web Application Framework. TEXT BOOKS: 1. The World of Scripting Languages, David Barron, WileyPublications. 2. Python Web Programming, Steve Holden and David Beazley, New Riders Publications. 3. Beginning PHP and MySQL, 3rd Edition, Jason Gilmore, Apress Publications (Dreamtech) REFERENCE BOOKS: 1. Open Source Web Development with LAMP using Linux, Apache, MySQL, Perl and PHP, J.Lee and B.Ware (Addison Wesley) PearsonEducation. 2. Programming Python, M.Lutz,SPD. 3. PHP 6 Fast and Easy Web Development, Julie Meloni and Matt Telles, Cengage LearningPublications. 4. PHP 5.1, I.Bayross and S.Shah, The X Team,SPD. 5. Core Python Programming, Chun, PearsonEducation. 6. Guide to Programming with Python, M.Dawson, CengageLearning. 7. Perl by Example, E.Quigley, PearsonEducation. 8. Programming Perl, Larry Wall, T.Christiansen and J.Orwant, O’Reilly,SPD Course Outcomes: At the end of the course the students are able to: Students will also learn to develop, maintain, and scale the performance of web sites using Smartytemplates. Student will be able to identify database and environment modifications to use TCL. Develop, debug, test, and execute sequences using the Editor and Runtime Console Support. Develop TCL sequences that: Perform process control calculations, manipulate arrays, and accessrecipes. Monitor and access functional elements and access/modify sequenceparameters. Tk is a platform-independent GUI framework developed for Tcl. From a Tcl shell (tclsh),Tk may be invoked using this command: package requiresTk. 3 UNIT NO TOPIC PAGE NO Introduction Introduction to PERL and Scripting Scripts and Programs 5-34 Characteristics of Scripting Languages, PERL-Names and Values, I Variables, Scalar Expressions, Control Structures, arrays, list, PHP Basics Features, Embedding PHP Code in your Web pages 35-60 Function, Creating a Function II Advanced PHP Programming: Php and Web Forms, Files 61-80 III PHP Authentication and Methodologies-Hard Coded, File Based, 81-121 Database Based, TCL-TK IV TCL Structure, syntax, Variables and Data in TCL 122-181 Python: Introduction to Python language, python-syntax, statements 182-197 V functions, Built-in-functions and Methods, Modules in python 197-200 4 UNIT-1 Introduction to PERL and Scripting Scripts and Programs, Origin of Scripting , Scripting Today, Characteristics of Scripting Languages. Web Scripting, and the universe of Scripting Languages. PERL-Names and Values, Variables, Scalar Expressions, Control Structures, arrays, list, hashes, strings, pattern and regular expressions, subroutines, advance perl -finer points of looping, pack and unpack, file system, eval, data structures, packages, modules, objects, interfacing to the operating system, Creating Internet ware applications, Dirty Hands Internet Programming, securityIssues. Scripts and programs Scripting is the action of typing scripts using a scripting language, distinguishing neatly between programs, which are written in conventional programming language such as C,C++,java, and scripts, which are written using a different kind of language. We could reasonably argue that the use of scripting languages is just another kind of programming. Scripting languages are used for is qualitatively different from conventional programming languages like C++ and Ada address the problem of developing large applications from the ground up, employing a team of professional programmers, starting from well-defined specifications, and meeting specified performance constraints. Scripting languages, on other hand, address different problems: . Building applications from ‘off the shelf’ components . Controlling applications that have a programmable interface . Writing programs where speed of development is more important than run-time efficiency. The most important difference is that scripting languages incorporate features that enhance the productivity of the user in one way or another, making them accessible to people who would not normally describe themselves as programmers, their primary employment being in some other capacity. Scripting languages make programmers of us all, to some extent. Origin of scripting The use of the word ‘script’ in a computing context dates back to the early 1970s,when the originators of the UNIX operating system create the term ‘shell script’ for 5 sequence of commands that were to be read from a file and follow in sequence as if they had been typed in at the keyword. e.g. an ‘AWKscript’, a ‘perl script’ etc.. the name ‘script ‘ being used for a text file that was intended to be executed directly rather than being compiled to a different form of file prior to execution. Other early occurrences of the term ‘script’ can be found. For example, in a DOS- based system, use of a dial-up connection to a remote system required a communication package that used proprietary language to write scripts to automate the sequence of operations required to establish a connection to a remote system. Note that if we regard a scripts as a sequence of commands to control an application or a device, a configuration file such as a UNIX ‘make file’ could be regard as a script. However, scripts only become interesting when they have the added value that comes from using programming concepts such as loops and branches. Scripting today SCRIPTING IS USED WITH 3 DIFFRENT MEANINGS 1. A new style of programming which allows applications to be developed much faster than traditional methods allow, and makes it possible for applications to evolve rapidly to meet changing user requirements. This style of programming frequently uses a scripting language to interconnect ‘off the shelf ‘ components that are themselves written in conventional language. Applications built in this way are called ‘glue applications’ ,and the language is called a ‘glue language’. A glue language is a programming language i,e an interpreted scripting language and is designed or suited for writing glue code – code is to connect software parts. They are especially useful for writing and maintaining: o Custom commands for a command shell o Smaller programs than those that are better implemented in a compiled language o "Wrapper" programs for executables, like a batch file that moves or manipulates files and does other things with the operating system before or after