Question
How will you get replace elements of an array

Answers

splice() function will remove the elements of @ARRAY designated by OFFSET and LENGTH, and replaces them with LIST, if specified. Finally, it returns the elements removed from the array.

splice @ARRAY, OFFSET [ , LENGTH [ , LIST ] ]

Following is the example −

#!/usr/bin/perl

@nums = (1..20);
print "Before - @nums
";

splice(@nums, 5, 5, 21..25);
print "After - @nums
";

This will produce the following result −

Before − 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
After − 1 2 3 4 5 21 22 23 24 25 11 12 13 14 15 16 17 18 19 20   Your Comment




More Software Questions..
What is the inputsplit in map reduce software?

What is software configuration management?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?

What are the minimum system requirements to run Photoshop? Is it possible to run Photoshop over linux?

Which oracle package is used to manage the oracle lock management services?

What is Latch Up? Explain Latch Up with cross section of a CMOS Inverter. How do you avoid Latch Up?

What is marker interface?

What types of partitioning are there for BW?



Search
Can you Answer!!
  • Q What is amalgamation?
  • Q Were there super continents before pangea?
  • Q The Central Government is to launch which mission for addressing gaps in health services in vulnerable and far-flung areas of the country ?
  • Q We have One company with a plant and another company with a sales organization. Which is better option between these - PO or Stock Transfer Order ?
  • Q Explain post?
  • Q What is the difference between Ant and Maven?
  • Q Name the world’s largest international maritime warfare exercise, being held from June 26 to August 1.
  • Q Submission to all that happens as inevitable
  • Q What is preliminary phase?
  • Q What is ment by incompatable object error in the report level?
  • Q What are components of report studio?