|
INTERVIEW QUESTIONS
PROGRAMMING LANGUAGES
PERL
DETAILS
Question: What does new $cur->{LINK} do?
Answer: $cur->new()->{LINK} The indirect object syntax only has a single token lookahead. That means if new() is a method, it only grabs the very next token, not the entire following expression. This is why `new $obj[23] arg' does't work, as well as why `print $fh[23] "stuff
"' does't work. Mixing notations between the OO and IO notations is perilous. If you always use arrow syntax for method calls, and nothing else, you'll not be surprised.
|
|
|
Category |
Perl Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 9313 users |
Added on |
9/11/2014 |
Views |
66206 |
Rate it! |
|
|
Question:
What does new $cur->{LINK} do?
Answer:
$cur->new()->{LINK} The indirect object syntax only has a single token lookahead. That means if new() is a method, it only grabs the very next token, not the entire following expression. This is why `new $obj[23] arg' does't work, as well as why `print $fh[23] "stuff
"' does't work. Mixing notations between the OO and IO notations is perilous. If you always use arrow syntax for method calls, and nothing else, you'll not be surprised. 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 does Perl not have overloaded functions?l
|
View Answer
|
|
Why does Perl not have overloaded functions?
|
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
|