# [at the top, before subroutine definitions and code] my %my_vars; # [...] sub call_variables { #pick up a string I've passed from previous program via 'spec_vars' my $spec_vars = param('spec_vars'); @my_vars{qw/one two three four five/} = split /~/, $spec_vars; } #### # [at the top, before subroutine definitions and code] my ($one, $two, $three, $four, $five); # [...] sub call_variables { #pick up a string I've passed from previous program via 'spec_vars' my $spec_vars = param('spec_vars'); ($one, $two, $three, $four, $five) = split /~/, $spec_vars; }