Monday, May 26, 2014

20 TOP Perl Scripting Interview Questions and Answers pdf

Most frequently Asked Perl Scripting Interview Questions and Answers for freshers and experienced pdf free download

1. Define Perl scripting?
In the IT market, Perl scripting is considered as a robust scripting language which is used in various fields. Perl is good at obtaining Regular expressions and in all the fields of application it is unique. Perl is a scripting language which is based on interpreter but not on the languages based on compiler. Al all the applications, optimization is used.

2. Why to use Perl scripting?
Perl scripting is mainly used in functional concepts as well as regular expressions, you can also design own policies to obtain generalized pattern using regular expression. Perl is compatible or supports more than 76 operating systems and 3000 modules and it is known as Comprehensive Perl Archive Network modules.

3. What is Perl?
Perl is a programming language which is based on shell, C, Lisp, etc. In general, Perl is mainly used for network operations, OS program and for developing some websites.

4. Why to use Perl?
•    It is a powerful interpreter for free.
•    Perl is flexible and portable. It is very easy to learn Perl language.

5. Why do you create an application for real time system in which processing speed is vital?
Perl is used in the following cases:
•    To process large text
•    When data manipulation is done by application
•    If you require fast developments expand to become libraries
•    To load database operations

6. Which is your favorite module and why it is?
CGI.pm is my favorite module and it handles several tasks such as printing the headers, parsing the form input and it handles sessions and cookies effectively.

7. How Perl warnings are turn on and why is it important?
In general, Perl excuse strange and also wrong code sometimes. Thus, the time spent for searching weird results and bugs in very high. You can identify common mistakes and strange places in the code easily when warnings are turned on. In the long run, the time required for debugging is saved a lot. There are numerous ways to turn on the warnings of Perl:
•    -w option is used on the command line for Perl one-liner
•    -w option on shebang line is used on windows or UNIX. Windows Perl interpreter do not require it.
•    For other systems, compiler documentation is checked or compiler warnings are selected.

8. Differentiate use and require?
Use:
•    This method is used for modules.
•    The objects which are included are varied at compilation time.
•    You need not give a file extension.
Require:
•    This method is used for both modules and libraries.
•    The objects are included are verified at run time.
•    You need not give file extension.

9. Distinguish my and local?
The variables which are declared using “my” lives only in that particular block ion which they are declared and inherited functions do not have a visibility that are called in that block. The variables which are defined as “local” are visible in that block and they have a visibility in functions which are called in that particular block.

10. Why Perl patterns are not regular expressions?
Perl patterns have back references
By the definition, a regular expression should determine next state in finite automaton without extra money to keep in previous state. State machine is required by the pattern / ([ab] +) c1/ to remember old states. Such patterns are disqualified as being regular expressions in the term’s classic sense.

11. What happens if a reference is returned to private variable?
Your variables are kept on track by the Perl, whether dynamic or else, and does not free things before you use them.

12. Define scalar data and variables?
The concept of data types is flexible, which is present in Perl. Scalar is a single thing such as a string or a number. The java concepts such as int, float, string, and double are similar to scalar concept of Perl. Strings and numbers are exchangeable. Scalar variable is nothing but a Perl variable which is used to store scalar data. A dollar sign $ is used by it which is followed by underscores or alphanumeric characters. It is a case sensitive.

13. Why –w argument is used with Perl programs?
-w option of the interpreter is used by most of the Perl developers especially in the development stage of an application. It is warning option to turn on multiple warning messages that are useful in understanding and debugging the application.

14. Which has highest precedence in between List and Terms? Explain?
In Perl, the highest precedence is for Perl. Quotes, variables, expressions in parenthesis are included in the Terms. The same level of precedence as Terms is for List operators. Especially, these operators have strong left word precedence.

15. Define a short circuit operator?
The C-style operator ll carries out logical operation which is used to tie logical clauses, overall value of true is returned if either clause is true. This operator is known as short-circuit operator because you need not check or evaluate right operand if the left operand is true.

16. In Perl, name different forms of goto and explain?
In Perl, there are three different forms for goto, they are:
•    goto name
•    goto label
•    goto expr
goto name is used along with subroutines, it is used only when it is required as it creates destruction in programs.  It is the second form of label where Execution is transferred to a statement labeled LABEL using goto LABEL. The last label form is goto EXPR which expects EXPR to evaluate label.

17. Can you add two arrays together?
Yes, it is possible to add two arrays together with a push function. A value or values to end of the array is added using push function. The values of list are pushed on to the end of an array using push function. Length of list is used to increase length of an array.

18. How shift command is used?
The first value of an array shifted using shift array function and it is returned, which results in array shortening by one element and moves everything from a place to left. If an array is not specified to shift, shift uses @ ARGV, the command line arguments of an array is passed to script or to an array named @.

19. Explain different types of eval statements?
In general, there are two types of eval statements they are:
•    Eval BLOCK and
•    Eval EXPR
An expression is executed by eval EXPR and BLOCK is executed by eval BLOCK. Entire block is executed by eval block, BLOCK. When you want your code passed in expression then first one is sued and to parse code in the block, second one is used.

20. Describe returning values from subroutines?
The value of last expression which is evaluated is the return value of subroutine or explicitly, a returned statement can be used to exit subroutine which specifies return value. This return value is evaluated in perfect content based on content of subroutine call.
The people who are looking for the Perl interview questions are at the right place as this article contains frequently asked interview questions. Here, you find the questions framed on important concepts of the Perl scripting language. Students can just have a glance on these questions to receive all the major concepts quickly to face the interview confidently. Attending a technical interview requires much preparation and the candidate must be very good at all the core concepts. Finally, the employer hires the candidate who gives correct answers in the interview as he suits best for that vacant position.

No comments: