Perl Interview Questions

Posted on 11:07 PM by Bharathvn

  1. What arguments do you frequently use for the Perl interpreter and what do they mean?
  2. What does the command ‘use strict’ do and why should you use it?
  3. What do the symbols $ @ and % mean when prefixing a variable?
  4. What elements of the Perl language could you use to structure your code to allow for maximum re-use and maximum readability?
  5. What are the characteristics of a project that is well suited to Perl?
  6. Why do you program in Perl?
  7. Explain the difference between my and local.
  8. Explain the difference between use and require.
  9. What’s your favorite module and why?
  10. What is a hash?
  11. Write a simple (common) regular expression to match an IP address, e-mail address, city-state-zipcode combination.
  12. What purpose does each of the following serve: -w, strict, -T ?
  13. What is the difference between for & foreach, exec & system?
  14. Where do you go for Perl help?
  15. Name an instance where you used a CPAN module.
  16. How do you open a file for writing?
  17. How would you replace a char in string and how do you store the number of replacements?
  18. When would you not use Perl for a project?
  19. What is the simplest type of data that Perl can work with?
  20. Which operator can be used to take the bottom item from an array?
  21. You want to close the directory handle EVAN. Which of the following should you use to accomplish this?
  22. You want your script to read in a value from the keyboard for a variable named $duo. What do you set $duo equal to in the program to have it read a keyboard value? __________ (Fill in the blank.)
  23. Your script has just read in a variable from the keyboard and you want to strip that variable of the newline character that came in. What operator should you use to perform this operation?