sub rm ($@) { my ($e,@a) = @_; my @t = @a; (splice(@a,0,--$e),splice(@t,++$e)); } my @array = (1..10); # # remove the 5th Element # @array = &rm(5,@array); print join ("\n",@array) . "\n";