Interview Helper
Translate Page To German Tranlate Page To Spanish Translate Page To French Translate Page To Italian Translate Page To Japanese Translate Page To Korean Translate Page To Portuguese Translate Page To Chinese
[Valid RSS feed]
 
Number Times Read : 759    
 
  Go To Article :    
Categories

Air India (2)
Campus Interviews (505)
Career Helper (6)
Certification Dumps (10)
Code Samples (118)
Competitive Exams (163)
Interview Questions (4686)
Test Dev (0)
Test Director (25)
test... (0)
test_php (0)
Walkin Interviews (20)
 
Stats
Total Articles: 758
Total Authors: 781
Total Downloads: 1183168


Newest Member
sukhvir chahal
 
   

Question Popularity: 99 or more times read
Submitted 2008-11-05 10:14:43 [Valid RSS feed]


Perl Interview Questions 1






Which has the highest precedence, List or Terms? Explain?

Terms have the highest precedence in perl. Terms include variables, quotes, expressions in parenthesis etc. List operators have the same level of precedence as terms. Specifically, these operators have very strong left word precedence.

What is a short circuit operator?

The C-Style operator, ll, performs a logical (or) operation and you can use it to tie logical clauses together, returning an overall value of true if either clause is true. This operator is called a short-circuit operator because if the left operand is true the right operand is not checked or evaluated.

What are the different forms of goto in perl? Explain?

The three forms of goto are as follows. They are

(i) Goto label

(ii) Goto name

(iii) Goto expr

The first form, goto LABEL, transfers execution to the statement labeled LABEL. The second form, goto EXPR, expects EXPR to evaluate to a label. The last form goto &name is used with subroutines. This goto statement is used only when there is a necessity as it can create havoc in a program.

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.

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 @-.

What are the different types of eval statements?

There are two different types of eval statements they are eval EXPR and eval BLOCK. Eval EXPR executes an expression and eval BLOCK executes BLOCK. Eval Block executes an entire block, BLOCK. First one is used when you want your code passed in the expression and the second one is used to parse the code in the block.

Determine the difference between my and local?

The fundamental difference between my and local is that my creates a new variable, whereas local saves a copy of an existing variable.

Explain about returning values from subroutines (functions)?

The return value of the subroutine is the value of the last expression evaluated or you can explicitly use a return statement to exit the subroutine specifying the return value. That return value is evaluated in the appropriate content depending on the content of the subroutine call.

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';

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.



Related Stuff
Answers
No answer submitted yet!! Be the first one to answer this question.
New Members
select
Sign up
select
learn more
Affiliate Sign in
Affiliate Sign In
 
Nav Menu
Home
Login
Submit Articles
Submission Guidelines
Top Articles
Link Directory
About Us
Contact Us
Privacy Policy
RSS Feeds

Actions
Print This Article
Add To Favorites

 
Sponsors

 

All Rights Reserved Interview Helper

Proudly associated with Job Interview Helper | Interviewhelper Articles