my @items; InitializeList(); sub InitializeList { undef @items; for my $text ( qw( one two three four five six seven eight nine ten ) ) { ... } }