#MyVars.pm package MyVars; use strict; use warnings; use Exporter (); our @ISA = 'Exporter'; our ($one,$two,$three,$four,$five); our @EXPORT = qw/$one $two $three $four $five call_variables/; 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; return; # nothing; this sub only sets the variables } 1; # in your script use MyVars; # declares variables (actually just aliases them to the ones in the MyVars package) # to start with, they will be undefined (or at least should be treated as such) call_variables(); # now you can say $fred = $one . $two;