On Tue, 12 Feb 2002, Kevin Butters wrote: > I have an array that I want to insert elements into. I > want to insert elements at specific points in the > array. > > Example: > > use strict: > > @week = ("Monday", "Wednesday", "Friday"); > > I want to expand the array to include Tuesday after > element 0 and Thursday after element 1
You can still use splice, but recursively: splice @week, 1, 1, 'Tuesday', splice(@week, 1); splice @week, 3, 1, 'Thursday', splice(@week, 3); print join(' ', @week), "\n"; This gives: Monday Tuesday Wednesday Thursday Friday -- Brett http://www.chapelperilous.net/ ------------------------------------------------------------------------ Even a hawk is an eagle among crows. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]