|
INTERVIEW QUESTIONS
PROGRAMMING LANGUAGES
PERL
DETAILS
Question: Why does Perl not have overloaded functions?
Answer: False so long as f() returns false, after which it returns true until g() returns true, and then starts the cycle again. This is scalar not list context, so we have the bistable flip-flop range operator famous in parsing of mail messages, as in `$in_body = /^$/ .. eof()'. Except for the first time f() returns true, g() is entirely ignored, and f() will be ignored while g() later when g() is evaluated. Double dot is the inclusive range operator, f() and g() will both be evaluated on the same record. If you don't want that to happen, the exclusive range operator, triple dots, can be used instead. For extra credit, describe this: $bingo = ( a() .. b() ) ... ( c() .. d() );
|
|
|
Category |
Perl Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 8601 users |
Added on |
9/11/2014 |
Views |
70440 |
Rate it! |
|
|
Question:
Why does Perl not have overloaded functions?
Answer:
False so long as f() returns false, after which it returns true until g() returns true, and then starts the cycle again. This is scalar not list context, so we have the bistable flip-flop range operator famous in parsing of mail messages, as in `$in_body = /^$/ .. eof()'. Except for the first time f() returns true, g() is entirely ignored, and f() will be ignored while g() later when g() is evaluated. Double dot is the inclusive range operator, f() and g() will both be evaluated on the same record. If you don't want that to happen, the exclusive range operator, triple dots, can be used instead. For extra credit, describe this: $bingo = ( a() .. b() ) ... ( c() .. d() ); Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
Why is it hard to call this function: sub y ?
|
View Answer
|
|
What does Perl do if you try to exploit the execve(2) race involving setuid scripts?
|
View Answer
|
|
Why are not Perls patterns regular expressions?
|
View Answer
|
|
What are scalar data and scalar variables?
|
View Answer
|
|
How to turn on Perl warnings? Why is that important?
|
View Answer
|
|
What happens when you return a reference to a private variable?
|
View Answer
|
|
What is Perl one-liner?
|
View Answer
|
|
How do I do fill_in_the_blank for each file in a directory?
|
View Answer
|
|
How to open and read data files with Perl
|
View Answer
|
|
Which of these is a difference between C++ and Perl?
|
View Answer
|
|
How do I set environment variables in Perl programs?
|
View Answer
|
|
Why we use Perl?
|
View Answer
|
|
Given a file, count the word occurrence (case insensitive)
|
View Answer
|
|
What is hash in perl?
|
View Answer
|
|
Explain the difference between "my" and "local" variable scope declarations. ?
|
- Perl Interview Questions & Answers">
View Answer
|
|
What is difference between "Use" and "require". In which case should "Use" be used and not "Require"?
|
View Answer
|
|
I have a variable named $objref which is defined in main package. I want to make it as a Object of Class XYZ. How could I do it?
|
View Answer
|
|
What's the significance of @ISA, @EXPORT @EXPORT_OK %EXPORT_TAGS list & hashes in a perl package? With example?
|
View Answer
|
|
How to Connect with SqlServer from perl and how to display database table info?
|
View Answer
|
|
what's the purpose of -w.strict,-T?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All Perl Interview Questions & Answers - Exam Mode /
Learning Mode
|