# I assume this is just an example, as '$c' and '@a' serve # no real purpose here my $sub; { my $tmp = $tmp1; # You could even skip assigning to '$tmp' if '$tmp1' # already 'enclosed' in another limited context $sub = sub { my $c = shift; my @a = ($tmp); return @a; }; }