PERL Interview Questions & Answers
PERL Interview Online Test
1. Why do you use Perl?
Show Answer
2. How do I set environment variables in Perl programs?
Show Answer
3. Which of these is a difference between C++ and Perl?
Show Answer
4. What is Perl one-liner?
Show Answer
5. Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?
Show Answer
6. What happens when you return a reference to a private variable?
Show Answer
7. What are scalar data and scalar variables?
Show Answer
8. Why aren't Perl's patterns regular expressions?
Show Answer
9. What does Perl do if you try to exploit the execve(2) race involving setuid scripts?
Show Answer
10. How do you print out the next line from a filehandle with all its bytes reversed?
print scalar reverse scalar
Show Answer
11. Why is it hard to call this function: sub y { "because" }
Show Answer
12. What does read() return at end of file?
Show Answer
13.
What does `new $cur->{LINK}' do? (Assume the current package has no new() function of its own.)
Show Answer
14. How do you find the length of an array?
Show Answer
15. What value is returned by a lone `return;' statement?
Show Answer
16. What's the difference between /^Foo/s and /^Foo/?
Show Answer
17. How to dereference a reference?
Show Answer
18. What does length(%HASH) produce if you have thirty-seven random keys in a newly created hash?
Show Answer
19. If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?
Show Answer
20. How do I do < fill-in-the-blank > for each element in an array?
Show Answer
21. How do I replace every character in a file with a comma?
Show Answer
22. When would `local $_' in a function ruin your day?
Show Answer
23. What happens to objects lost in "unreachable" memory, such as the object returned by Ob->new() in `{ my $ap; $ap = [ Ob->new(), \$ap ]; }' ?
Show Answer
24. How do you match one letter in the current locale?
/[^\W_\d]/
Show Answer
25. How do you give functions private variables that retain their values between calls?
Show Answer