use warnings; use strict; initializeVars(); ... do stuff with the variables ... sub initializeVars{ our ($str1, $str2, $str3); our @arr = ('1', '2', '3'); }