Perl is a versatile programming language that supports both procedural programming (scripts with subroutines and control flow) and object-oriented programming (creating objects, classes, and using inheritance). While Perl was originally procedural, Perl 5 introduced full OOP support with packages, bless operator, and method invocation. The 'Both' option correctly captures Perl's dual nature.
Question 2Multiple Choice (Single Answer)
Pick the odd one out
ord
sort
reverse
foreach
The 'foreach' keyword is the odd one out because it's a looping construct that iterates over a list (a control flow statement), whereas ord(), sort(), and reverse() are all built-in functions that transform and return values. Functions like ord (converts character to ordinal), sort (orders a list), and reverse (flips a list) are operators that take input and produce output, while foreach executes a block of code for each element.