Monday 9 February 2015

Perl Scripting Technical Interview Questions and Answers (Page 2)

Below are some important Perl Scripting interview questions which are asked in most MNC company interviews for beginners or professionals.

6) How does a “grep” function perform?
Grep returns the number of lines the expression is true. Grep returns a sub list of a list for which a specific criterion is true. This function often involves pattern matching. It modifies the elements in the original list.

7) Explain about Typeglobs?
Type globs are another integral type in perl. A typeglob`s prefix derefrencer is *, which is also the wild card character because you can use typeglobs to create an alias for all types associated with a particular name. All kinds of manipulations are possible with typeglobs.

8) Is there any way to add two arrays together?
Of course you can add two arrays together by using push function. The push function adds a value or values to the end of an array. The push function pushes the values of list onto the end of the array. Length of an array can be increased by the length of list.

9) How to use the command shift?
Shift array function shifts off the first value of the array and returns it, thereby shortening the array by one element and moving everything from one place to the left. If you don’t specify an array to shift, shift uses @ ARGV, the array of command line arguments passed to the script or the array named @-.

10) What exactly is grooving and shortening of the array?
You can change the number of elements in an array simply by changing the value of the last index of/in the array $#array. In fact, if you simply refer to a nonexistent element in an array perl extends the array as needed, creating new elements. It also includes new elements in its array.
More Questions & Answers :-

No comments:

Post a Comment