Question

I am writing a report on the language Perl and need help with listing its basic...

I am writing a report on the language Perl and need help with listing its basic features.

This includes:

Paradigm

Data Types

Control Flow

Subprograms

Object-orientation

Any basic information you can give you would help in writing this paper.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Perl Language :

  • Perl stands for Practical Extraction and Report Language.
  • Mainly for text processing.
  • It is a programming language developed by Larry Wall.
  • It is cross platform.
  • It is open source.
  • It is an interpreted language.
  • File extension is .pl or .PL
  • For commenting # is used.
  • Each statement is terminated by a semicolon.

Paradigm :

  • Perl supports multi paradigm.
  • It is an object oriented language.
  • It is a imperative language.
  • It is a functional language.

Data Types :

  • There are three basic types Scalar, Hashes, Arrays.
  • Scalar is a simple variable which are preceded by a dollar sign.They are number, string etc..
  • Hashes are sets of key value pairs.They are unordered sets.They use keys to access a value.They are preceded by a percent sign.
  • Arrays store different values that belongs to same datatype.
  • Numerical literals include Integer, Negative integer, Floating point , Scientific notation, Hexadecimal, octal.
  • String literal are enclosed between double or single quotes.

Control Statements :

  • if , syntax is if(Expression){statements}
  • if-else, syntax is if(Expression){statement for true condition}else{statement for false condition}
  • if-elseif-else, if(condition 1){statement block}elseif(condition2){statement block}.........else{statement block}
  • while , Label : while(expression){statements} or while(expression){statements} . Label is optional.
  • until, Label : until(expression){statements} or until(expression){statements} . Label is optional.
  • for , Label : for(initialization;condition;update){statement block} .Label is optional.
  • foreach, Label : foreach Variable (Expression){ statements} . Label is optional.

Subprograms :

  • Subroutine or function.
  • They are a set of instructions which are represented by a name.
  • sub keyword is used to define a function.
  • Syntax : sub subroutineName{ block of statements } .

Object Orientation :

  • Perl is an object oriented language.
  • Main terms are object, class, method.
  • Object is a reference to a datatype.
  • Class contains methods to manipulate methods.
  • Method means functions.
  • To create a class , we need to create a package using keyword package .
  • Syntax : package Name;
Add a comment
Know the answer?
Add Answer to:
I am writing a report on the language Perl and need help with listing its basic...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT