On 25 Mar, 23:50, [EMAIL PROTECTED] (Sharan Basappa) wrote: > Hi, > > Is there a way I can copy only part of an array into another array. > For example, I want to copy only first 8 elements of source array > into destination array. > > Regards
Sure there is, @rainbow = ("red", "green", "blue", "yellow", "orange", "violet", "indigo"); @slice = @rainbow[0..2]; # slice your array from index 0 until index 2 (inclusive) print @slice; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/