#! perl -sw use strict; sub setmode ($\@) { ## the prototype makes the reference our @array; ## satisfy strict my $val = shift; local *array = shift; ## alias the reference splice @array, 1, 0, $val; ## do normal array operations } my @a = qw( one two three ); print join( "\n", @a ), "\n__________\n"; setmode 'add_test', @a; print join( "\n", @a ); __END__ [ 7:19:41.56] P:\test>junk3 one two three __________ one add_test two three