Perl: how to make variables from requiring script available in required script
example out.pl: (my|our|local|global|whatever???) var = "test"; require("inside.pm"); inside.pm: print $var; I don't want to use packages - it's overwhelming my needs :) thanks! It will work with our . $ cat out.pl our $var = "test"; require("inside.pm"); $ cat inside.pm print "Testing...\n"; print "$var\n"; $ perl out.pl Testing... test This works because our makes $var global, and inside.pm is being executed in the scope with $var defined. Not sure it is recommended technique, but it is an interesting question nevertheless! EDIT : Need to clarify (okay patch) the answer based on a comment: