Multiple choice technology web technology

How to replace certain number of elements of array in Perl ?

  1. slice

  2. splice

  3. substr

  4. replace

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

splice is the Perl function for removing or replacing elements in an array - it can insert, delete, or replace elements at a specified position. slice (option A) is an operation, not a function. substr is for strings, and "replace" doesn't exist as a built-in.