PrepareInterview Logo
Job Seeker Login | Employer Login
About Us | Contact Us | Site Map | Advertise

Job Categories

 FRESHERS CORNER
 IT SOFTWARE JOBS
 BPO/CALL CENTER JOBS
 GENERAL JOBS
 GOVERNMENT JOBS
 LATEST IT NEWS
FREE SMS Job Alert
Top Links with more Hits
 Interview DOs & DON'Ts
 Types of interviews
 Top BPO Interview Tips
 Job Interview Questions
 49 Interview Qns & Ans
 Precautions to Take
 Dress to Wear
 Animation Industry
 Voice Acting
 6 Top Job Search Tips
 Questions to Ask Employers
 HR Interviews
 Cover Letter
 Salary Negotiations
 Thankyou Letters
 
Top Interview Questions
 Java Questions (25)
 SAP Questions(20)
 C++
 OOPS
 ASP.NET (50)
 Java FAQ (45)
 PHP Interview(54)
 Oracle (50)
 Java-J2EE Interview Qns
 Mainframe Questions
 ASP.NET Tips(41)
 Java Top Questions(25)
 Software Testing (40)
 Dot Net
 Common Java FAQ(25)
 Networking (64)
 General Aptitude
 Java Interview FAQ (25)
 Vocabulary
FREE SMS Job Alert
 
PEAR - An Introduction
 
 Get WALK-IN Alert On Your MOBILE Or Send SMS - 'ON Walk-InJobs' to 9870807070
What Is Perl?

Perl is an acronym, short for Practical Extractionand Report Language. It was designed by Larry Wallas a tool for writing programs in the UNIX environment and iscontinually being updated and maintained by him.

For its many fans, Perl provides the best of several worlds. Forinstance:

  • Perl has the power and flexibility of a high-level programminglanguage such as C. In fact, as you will see, many of the featuresof the language are borrowed from C.
  • Like shell script languages, Perl does not require a specialcompiler and linker to turn the programs you write into workingcode. Instead, all you have to do is write the program and tellPerl to run it. This means that Perl is ideal for producing quicksolutions to small programming problems, or for creating prototypesto test potential solutions to larger problems.
  • Perl provides all the features of the script languages sedand awk, plus features not found in either of these two languages.Perl also supports a sed-to-Perl translator and an awk-to-Perltranslator.

In short, Perl is as powerful as C but as convenient as awk, sed,and shell scripts.

Perl is very easy to learn. Indeed, if you arefamiliar with other programming languages, learning Perl is asnap. Even if you have very little programming experience, Perlcan have you writing useful programs in a very short time.

How Do I Find Perl?

To find out whether Perl already is available on your system,do the following:

  • If you are currently working in a UNIX programming environment,check to see whether the file /usr/local/bin/perl exists.
  • If you are working in any other environment, check the placewhere you normally keep your executable programs, or check thedirectories accessible from your PATH environment variable.

If you do not find Perl in this way, talk to your system administrator and ask whether she or he has Perl running somewhere else. If you don't have Perl running in your environment, don't despair-read on!

A Sample Perl Program

Now that Perl is available on your system, it's time to show you a simple program that illustrates how easy it is to use Perl. Listing 1.1 is a simple program that asks for a line of input and writes it out.

Listing 1.1. A simple Perl program that reads and writes a line of input.
1: #!/usr/local/bin/perl
2: $inputline = <STDIN>;
3: print( $inputline );

$program1_1
This is my line of input.
This is my line of input.
$

Line 1 is the header comment. Line 2 reads a line of input. Line 3 writes the line of input back to your screen.

The following sections describe how to create and run this program, and they describe it in more detail.

Running a Perl Program To run the program shown in Listing 1.1, do the following:

  1. Using your favorite editor, type the previous program and save it in a file called program1_1.
  2. Tell the system that this file contains executable statements. To do this in the UNIX environment, enter the command
    $ chmod +x program1_1
  3. Run the program by entering the command
    $ program1_1

When you run program1_1, it waits for you to enter a line of input. After you enter the line of input, program1_1 prints what you entered, as follows:


$ program1_1
This is my line of input.
This is my line of input.
$
 
GET JOB ALERT -FREE!!
Tagged Twitter Facebook Linked In Blogger Free SMS Google Group ibibo
Login
Google Groups
Subscribe for Jobs
Email:
Visit this group
Bookmark and Share
Job & General Tips
 

Success Stories

"My hearty thanks for the interview tips provided in your website. Thanks Prepareinterview.com."
- Vijay Gunda, Bangalore
 
"Hey I got job yar..Both Interview Tips and Job updates are your Plus. Keep going."
- Laxman D Mahamuni, Pune
 
"Fresher jobs are really helpful for freshers like me to get good job in this resession time. Even I will post some jobs. Thank you."
- Sandeep Kumar, Chennai
 
 
Usefull Links


Copyright © 2008 PrepareInterview Inc.  Disclaimer