Perl Quiz (Set 8) Perl (Set 8) 1 / 10 In Perl, what does the 'last' statement do within a loop? Terminates the entire program Exits the current iteration of the loop Exits the loop immediately Jumps to the end of the loop body 2 / 10 What does the Perl 'ne' operator do? Compares if two strings are not equal Compares if two strings are equal Assigns a value to a variable Performs a bitwise XOR operation 3 / 10 Which operator is used for the logical OR in Perl? && ! & || 4 / 10 In Perl, what does the 'pop' function do? Removes the first element of an array Removes the last element of an array Appends an element to the end of an array Deletes all elements from an array 5 / 10 What is the purpose of the 'keys' function in Perl? Extracts the values from a hash Finds the average of numeric values Returns a list of keys from a hash Searches for a key in a hash 6 / 10 In Perl, how do you declare an array? $array = [1, 2, 3]; @array = (1, 2, 3); %array = (1, 2, 3); &array = (1, 2, 3); 7 / 10 What is the purpose of the 'until' loop in Perl? To execute a loop To perform conditional execution until a condition is true To define a custom function To iterate over a range of numbers 8 / 10 In Perl, how do you declare a scalar variable? $variable = value; @variable = value; %variable = value; &variable = value; 9 / 10 What is the Perl 'cmp' operator used for? Compares if two strings are equal Compares if two strings are not equal Compares two strings for equality, returning -1, 0, or 1 Compares two strings for length 10 / 10 In Perl, what is the purpose of the 'for' loop? To iterate over a range of numbers To loop through an array or list To perform conditional execution while a condition is true To define a custom function Your score isThe average score is 0% 0% Restart quiz