Perl Quiz (Set 11) Perl (Set 1) 1 / 14 In Perl, what does the 'redo' statement do within a loop? Restarts the loop from the beginning Repeats the current iteration of the loop Skips the current iteration and goes to the next one Terminates the loop 2 / 14 Which operator is used for the logical NOT in Perl? && || ! & 3 / 14 In Perl, what does the 'each' function do? Returns the current element of an array Returns the current key-value pair from a hash Returns the index of the current element in an array Returns the number of elements in an array 4 / 14 What is the purpose of the 'map' function in Perl? Applies a function to each element of an array Searches for a substring in a string Filters elements of an array based on a condition Counts the occurrences of a character in a string 5 / 14 In Perl, how do you remove an element from an array? remove(array, index); delete(array, index); splice(array, index, 1); pop(array); 6 / 14 What is the purpose of the 'values' function in Perl? Returns a list of values from a hash Extracts the keys from a hash Finds the average of numeric values Searches for a value in a hash 7 / 14 In Perl, how do you declare a hash? %hash = (key1 => value1, key2 => value2); @hash = (key1 => value1, key2 => value2); $hash = (key1 => value1, key2 => value2); &hash = (key1 => value1, key2 => value2); 8 / 14 What is the Perl 'ge' operator used for? Compares if one string is greater than or equal to another Compares if one string is less than or equal to another Compares if two strings are equal Performs a bitwise right shift operation 9 / 14 In Perl, what does the 'goto' statement do? Jumps to the beginning of the program Transfers control to a specified label Exits the current loop Throws an exception 10 / 14 A scalar variable can hold 256 characters 1024 characters 32768 characters Depends on system specifications 11 / 14 The statement $myvar = <STDIN> Stores the string “STDIN” in $myvar Reads a line and saves in $myvar Stores the string “ Returns an error that double quotes are missing 12 / 14 If $a = “Ape” and $b = 3 the result of $a x $b is error Ape3 ApeApeApe 3Ape 13 / 14 A function that requires a list argument can take an array but a function that requires an array argument cannot take a list. True or False True False 14 / 14 Value of $expr = 1 + 2 * 3 – 4 is 5 -3 3 None of the above Your score isThe average score is 0% 0% Restart quiz