http://www.perlmonks.org?node_id=1064447

dvinay has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks,

I have an requirement where, in array has 120 elements and these are divided into sets of 3, so there are 40 sets, each containing 3 commands, now i need to insert or add an new element at multiples of 10's set (i.e after 10th set, 20th Set 30th set, 40th set....! is there any way to do it..? i tried splice function but didnt get required results.

Any help is appreciated

sample array is as given below its only having 20 sets that is totally 60 commands or elements now i need to add an new element at every 10th set element

my @array ("create", "mount", "remove","create", "mount", "remove","cr +eate", "mount", "remove","create", "mount", "remove","create", "mount +", "remove","create", "mount", "remove","create", "mount", "remove"," +create", "mount", "remove","create", "mount", "remove","create", "mou +nt", "remove","create", "mount", "remove","create", "mount", "remove" +,"create", "mount", "remove","create", "mount", "remove","create", "m +ount", "remove","create", "mount", "remove","create", "mount", "remov +e","create", "mount", "remove","create", "mount", "remove","create", +"mount", "remove");