All India Exams
Home AptitudeBankEngineeringEnglishGKInterviewOnline TestPlacement PapersReasoning
  • Home
  • Aptitude
  • Bank
  • Engineering
  • English
  • GK
  • Interview
  • Online Test
  • Placement Papers
  • Reasoning

Perl Interview Questions and Answers

Here you can find Perl Interview Questions and Answers.

Why Perl Interview Questions and Answers Required?

In this Perl Interview Questions and Answers section you can learn and practice Perl Interview Questions and Answers to improve your skills in order to face technical inerview by IT companies. By Practicing these interview questions, you can easily crack any Perl interview.

Where can I get Perl Interview Questions and Answers?

AllIndiaExams provides you lots Perl Interview Questions and Answers with proper explanation. Fully solved examples with detailed answer description. All students, freshers can download Perl Interview Questions and Answers as PDF files and eBooks.

How to solve these Perl Interview Questions and Answers?

You no need to worry, we have given lots of Perl Interview Questions and Answers and also we have provided lots of FAQ's to quickly answer the questions in the Perl technical interview.

Perl Interview Questions and Answers

What is Perl?

Perl, sometimes said as Practical Extraction and Reporting Language, is an interpreted programming language with a huge number of uses, libraries and resources. Perl was first brought into being by Larry Wall circa 1987 as a general purpose Unix scripting language to make his programming work simpler. Although it has far surpassed his original creation, Larry Wall still oversees development of the core language, and the newest version, Perl 6.

Perl Interview Questions and Answers

Which of these is a difference between Perl and C++ ?

Perl can have objects whose data cannot be accessed outside its class, but C++ cannot. Perl can use closures with unreachable private data as objects, and C++ doesn't support closures. Furthermore, C++ does support pointer arithmetic via `int *ip = (int*)&object', allowing you do look all over the object. Perl doesn't have pointer arithmetic. It also doesn't allow `#define private public' to change access rights to foreign objects. On the other hand, once you start poking around in /dev/mem, no one is safe.

Perl Interview Questions and Answers

Why do you use Perl?

Perl is a powerful free interpreter. Perl is portable, flexible and easy to learn.

Perl Interview Questions and Answers

How do I set environment variables in Perl programs?

you can just do something like this: $path = $ENV{'PATH'}; As you may remember, "%ENV" is a special hash in Perl that contains the value of all your environment variables. Because %ENV is a hash, you can set environment variables just as you'd set the value of any Perl hash variable. Here's how you can set your PATH variable to make sure the following four directories are in your path:: $ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin:/home/yourname/bin';

Perl Interview Questions and Answers

Which of these is a difference between C++ and Perl?

Perl can have objects whose data cannot be accessed outside its class, but C++ cannot. Perl can use closures with unreachable private data as objects, and C++ doesn't support closures. Furthermore, C++ does support pointer arithmetic via `int *ip = (int*)&object', allowing you do look all over the object. Perl doesn't have pointer arithmetic. It also doesn't allow `#define private public' to change access rights to foreign objects. On the other hand, once you start poking around in /dev/mem, no one is safe.

Perl Interview Questions and Answers

How to open and read data files with Perl?

Data files are opened in Perl using the open() function. When you open a data file, all you have to do is specify (a) a file handle and (b) the name of the file you want to read from. As an example, suppose you need to read some data from a file named "checkbook.txt". Here's a simple open statement that opens the checkbook file for read access: open (CHECKBOOK, "checkbook.txt"); In this example, the name "CHECKBOOK" is the file handle that you'll use later when reading from the checkbook.txt data file. Any time you want to read data from the checkbook file, just use the file handle named "CHECKBOOK". Now that we've opened the checkbook file, we'd like to be able to read what's in it. Here's how to read one line of data from the checkbook file: $record = < CHECKBOOK > ; After this statement is executed, the variable $record contains the contents of the first line of the checkbook file. The "<>" symbol is called the line reading operator. To print every record of information from the checkbook file open (CHECKBOOK, "checkbook.txt") || die "couldn't open the file!"; while ($record = < CHECKBOOK >) { print $record; } close(CHECKBOOK);

Perl Interview Questions and Answers

How do I do fill_in_the_blank for each file in a directory?

Here's code that just prints a listing of every file in the current directory: #!/usr/bin/perl -w opendir(DIR, "."); @files = readdir(DIR); closedir(DIR); foreach $file (@files) { print "$file\n"; }

Perl Interview Questions and Answers

How do I generate a list of all .html files in a directory?

Here's a snippet of code that just prints a listing of every file in the current directory that ends with the extension .html: #!/usr/bin/perl -w opendir(DIR, "."); @files = grep(/\.html$/,readdir(DIR)); closedir(DIR); foreach $file (@files) { print "$file\n"; }

Perl Interview Questions and Answers

What is Perl one-liner?

There are two ways a Perl script can be run: --from a command line, called one-liner, that means you type and execute immediately on the command line. You'll need the -e option to start like "C:\ %gt perl -e "print \"Hello \";". One-liner doesn't mean one Perl statement. One-liner may contain many statements in one line. --from a script file, called Perl program.

Perl Interview Questions and Answers

Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?

${var} is the lexical variable $var, and ${"var"} is the dynamic variable $var. Note that because the second is a symbol table lookup, it is disallowed under `use strict "refs"'. The words global, local, package, symbol table, and dynamic all refer to the kind of variables that local() affects, whereas the other sort, those governed by my(), are variously knows as private, lexical, or scoped variable.

- Page 5
Home InterviewTechnical Interview Questions and AnswersWeb TechnologiesPerl Interview Questions

Perl Interview Questions & Answers

  • How do I replace every character in a file with a comma?
  • What is the easiest way to download the contents of a URL with Perl?
  • How to concatenate strings with Perl?
  • How do I read command-line arguments with Perl?
  • When would `local $_' in a function ruin your day?
  • What happens to objects lost in "unreachable" memory, such as the object returned by Ob->new() in `{ my $ap; $ap = [ Ob->new(), \$ap ]; }' ?
  • Assume that $ref refers to a scalar, an array, a hash or to some nested data structure. Explain the following statements:
  • How do you match one letter in the current locale?
  • How do I print the entire contents of an array with Perl?
  • Perl uses single or double quotes to surround a zero or more characters. Are the single(' ') or double quotes (" ") identical?
  • «
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • »

Mock Tests & Online Quizzes

  • Aptitude Online Test

  • Reasoning Online Test

  • GK Online Test

  • English Online Test

  • RRB Mock Test

  • RBI Mock Test

  • Free SBI Mock Test

  • IBPS Mock Test FREE

  • SSC Mock Test

  • CAT Exam Mock Test

  • GATE Mock Test

  • IT Courses Quiz

Questions and Answers

  • Aptitude Questions
  • Verbal Reasoning Questions
  • Non Verbal Reasoning
  • Logical Reasoning Questions
  • Data Sufficiency Questions
  • Data Interpretation
  • eLitmus Sample Papers
  • ECE Questions and Answers
  • EEE Questions and Answers
  • Verbal Ability Questions
  • GK Questions

Programming Quiz

  • C Programming
  • C++ Programming
  • PHP Programming
  • Java Programming
  • Python Programming
  • DataScience MCQ
  • Hadoop MCQ
  • Mongo DB MCQ
  • MySQL MCQ

Interview Questions

  • Java Interview Questions
  • .Net Interview Questions
  • Networking Interview Questions
  • C Language Interview Questions
  • C++ Interview Questions
  • Testing Interview Questions
  • Android Interview Questions
  • HR Interview Questions
  • Group Discussion Topics

Mock Tests

  • CAT Mock Test
  • SSC Mock Test
  • AMCAT Mock Online Test
  • LIC Mock Test
  • IBPS Mock Test
  • RRB Mock Test
  • RBI Mock Test
  • Free SBI Mock Test
© by AllIndiaExams.in. All Rights Reserved | Copyright | Terms of Use & Privacy Policy