Jjjnnnnnnn nnn ummmm hai ra hai u happy birthday u u happy u uzz my dear u happy u happy birthday to you too bangaram ji ki vacha ra exam undhe mrg nuchi thinnaledhu mrg u happy birthday to you too bangaram u uzz my love you u happy birthday to you too bangaram u happy birthday zzzzzzz God bless you all the best for your life and your family a very happy u happy birthday to you too bangaram u happy birthday to you too u happy birthday to you too bangaram u happy birthday to you too bangaram u happy birthday to you too bangaram u happy birthday to you too bangaram u u happy birthday to you too bangaram u
1. Scripting Languages
Dr. Dilshad Ansari,
Dept of CSE,
CMR College of Engineering & Technology
Email :- m.dilshadcse@cmrcet.org
Mob: +91-9816387077
2. Unit III
Introduction to PERL and Scripting Scripts and Programs,
Origin of Scripting, Scripting Today, Characteristics of
Scripting Languages, Uses for 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
3. Programming Scripting
Programming languages are compiled to
machine code and run on the hardware
of the underlying Operating system. One
must use a certain IDE (Integrated
Development Environment) to make use
of programming languages. The
programmer provides a set of
instructions for a computer to achieve a
certain goal. Certain algorithms can also
be implemented by writing programs.
Scripting languages have evolved to
become powerful. Now they are not
limited to create small scripts to
automate operations on a software
system. One can also build a rich
application with scripting languages. It
can manipulate, customize and automate
the facilities of an existing system. Useful
functionality is already available via an
interface; scripting languages provide a
mechanism for exposing functionality to
program control.
4. Scripts and Programs
1. Script is interpreted by Interpreter
2. Scripts can control another business
applications
Example
PHP controls web server
Java Script controls web browser
VB controls MS office application
3. Script can not executed as stand-alone
Ex. Ruby, Python, R, Perl, Java script,
PHP,VB,TCL etc..
Applications:
1.To automate certain tasks in a program
2. Extracting information from a data set
3. Less code as compared to traditional
programming languages
1. Program is compiled by compiler
2. Program executed independently without
the influence of another application
Example
C, C++,JAVA, C#, etc.
Applications:
1.They typically run inside a parent program
like scripts
2. More compatible while integrating code
with mathematical models
3. Languages like JAVA can be compiled and
then used on any platform.
5. Origins of Scripting
Basically the use of the word ‘script’ in an
UNIX operating system create the term ‘shell
script’ for 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.
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
6. scripting languages?
A scripting language is a programming
language that executes tasks within a special
run-time environment by an interpreter
instead of a compiler. They are usually short,
fast, and interpreted from source code or
bytecode.
Using a scripting language is preferable
depending on your goals and environment. As
they are a series of commands executed with no
need for a compiler, they are cross-platform and
do not require special software to be installed in
order to run — except for a web browser, of
course.
Types of scripting languages
There are two main types: server-side and
client-side. They differ on where the code is
run from, which affects not only the actual
languages chosen but also the performance
and their capabilities.
1. Server-side scripting language
2. Client-side scripting language
7. Types of S L
Server-side scripting language:-
The term server-side scripting language refers to those that run off a web
server. Since it performs from the back-end side, the script is not visible
to the visitor. Because of that, it is a more secure approach.
They are often used to create dynamic websites and platforms, handle
user queries, and generate and provide data and others. A famous
example of server-side scripting is the use of PHP inWordPress.
Examples: PHP, Python, Node.js, Perl, and Ruby.
8. Types of S L
Client-side scripting language:
Unlike the above, client-side scripting languages run off the user’s
browser. It is usually performed at the front-end, which makes it visible
to visitors and makes it less vulnerable to exploits and leaks. As such, it is
often used to build user interfaces and lighter functionality such as that.
Since it runs locally, they usually provide better performance and,
therefore, do not strain your server.
Examples: HTML, CSS, jQuery, and JavaScript.
9. Scripting Today
Scripting allows application to be developed much faster than
traditional methods.
Use to manipulate, customize, automate the existing system
EXAMPLE. Use of client side scripting and Making dynamic HTML for
interactive and feature rich enhanced web pages
UNIX OS used shell script for system management for administration
aspect
Apache web server has an embedded PERL interpreter for CGI scripts
11. Characteristics of Scripting Languages
Integrated Compile and Run:
SL are characterized as interpreted
languages.
SL operate on an immediate execution
basis, without the need to issue separate
commands to compile the program and
then to run the resulting object file, and
without the need to link extensive
libraries into the object code.
Low overhead and ease of use:
Less no.of data types
Less no. of data structures
Enhanced Functionality:
provide string manipulation based on the
use of regular expressions, while other
languages provide easy access to low-level
operating system facilities or to the API,
or object exported by an application
Efficiency is not an issue:
Abstraction:
Information hiding, to spare users the
details of internal variable types, data
storage, and memory management.
12. Web Scripting
Web is the most fertile areas for the application of scripting languages.
Web scripting divides into three areas
a. processing forms
b. creating pages with enhanced visual effects and user interaction
c. generating pages ’on the fly’ from material held in database.
13. Web Scripting Contd..
Processing Web forms: In the original implementation of the web ,
when the form is submitted for processing, the information entered
by the user is encoded and sent to the server for processing by a CGI
script that generates an HTML page to be sent back to the Web
browser. This processing requires string manipulation to construct the
HTML page that constitutes the replay, and may also require system
access , to run other processes and to establish network connections.
Perl is also a language that uses CGI scripting. Alternatively for
processing the form with script running on the server it possible to do
some client –side processing within the browser to validate form data
before sending it to the server by using JavaScript,VBScript etc.
Dynamic Web pages: ‘Dynamic HTML’ makes every component of
a Web page (headings, anchors, tables etc.) a scriptable object. This
makes it possible to provide simple interaction with the user using
scripts written in JavaScript/Jscript or VBScript, which are
interpreted by the browser. Microsoft’s ActiveX technology allows the
creation of pages with more elaborate user interaction by using
embedded visual objects called ActiveX controls. These controls are
scriptable objects, and can in fact be scripted in a variety languages.
This can be scripted by using Perl scripting engine.
Dynamically generated HTML:
Another form of dynamic Web page is
one in which some or all of the HTML
is generated by scripts executed on the
server. A common application of the
technique is to construct pages whose
content is retrieved from a database.
For example, Microsoft’s IIS web
server implements Active Server Pages
(ASP), which incorporate scripts in
Jscript orVBScript
14. Uses of Scripting Languages
A scripting language is a programming language designed for integrating and
communicating with other programming languages.
The scripting language is basically a language where instructions are written for a
run time environment.
They do not require the compilation step and are rather interpreted. It brings new
functions to applications and glue complex system together.
15. Uses of Scripting Languages Contd..
bash: It is a scripting language to work in the Linux interface. It is a lot easier to use bash to create
scripts than other programming languages. It describes the tools to use and code in the command line
and create useful reusable scripts and conserve documentation for other people to work with.
Node js: It is a framework to write network applications using JavaScript. Corporate users of
Node.js include IBM, LinkedIn, Microsoft, Netflix, PayPal,Yahoo for real-time web applications.
Ruby: There are a lot of reasons to learn Ruby programming language. Ruby’s flexibility has allowed
developers to create innovative software. It is a scripting language which is great for web development.
Python: It is easy, free and open source. It supports procedure-oriented programming and object-
oriented programming. Python is an interpreted language with dynamic semantics and huge lines of
code are scripted and is currently the most hyped language among developers.
Perl: A scripting language with innovative features to make it different and popular. Found on all
windows and Linux servers. It helps in text manipulation tasks. High traffic websites that use Perl
extensively include priceline.com, IMDB.
16. Uses of Scripting Languages Contd..
advantages of scripting languages:
Easy learning: The user can learn to code in scripting languages quickly, not much knowledge of web
technology is required.
Fast editing: It is highly efficient with the limited number of data structures and variables to use.
Interactivity: It helps in adding visualization interfaces and combinations in web pages. Modern web pages
demand the use of scripting languages. To create enhanced web pages, fascinated visual description which
includes background and foreground colors and so on.
Functionality: There are different libraries which are part of different scripting languages. They help in
creating new applications in web browsers and are different from normal programming languages.
Application of Scripting Languages: Scripting languages are used in many areas:
Scripting languages are used in web applications. It is used in server side as well as client side. Server side
scripting languages are: JavaScript, PHP, Perl etc. and client side scripting languages are: JavaScript, AJAX,
jQuery etc.
Scripting languages are used in system administration. For example: Shell, Perl, Python scripts etc.
It is used in Games application and Multimedia.
It is used to create plugins and extensions for existing applications.
17. Installation Steps for perl
Step1: Download perl
https://www.activestate.com/products/activeperl/downloads/
step2:To check if you have perl installed on aWindows PC, search in the start bar
for Perl or run the following on the Command Line (cmd.exe): C:UsersYour
Name>perl --version
Step3: change by default path from current working directory to below path
c:/>cd perl
C:/>cd scripts
Step4: C:UsersYour Name>perl sample.pl
18. Installation Steps for perl
Script:
#test demo
print "Enter your name: ";
$name=<STDIN>;
print "Hello ${name}";
19. Installation Steps for Ruby
Step1: Download Ruby
https://www.ruby-lang.org/en/downloads/
step2:To check if you have Ruby installed on aWindows PC, search in the start bar
for Ruby or run the following on the Command Line (cmd.exe): C:UsersYour
Name>Ruby --version
Step3: change by default path from current working directory to below path
c:/>cd ruby
C:/>cd scripts
Step4: C:UsersYour Name>ruby sample.rb