http://qs1969.pair.com?node_id=384126


in reply to cleaning up code with "do" ?

That says that subs in your file cannot participate in lexical closures with variables in the including file. Big packages often have such closures, and subs imported with do will fail. Make sure all subs get all their parameters from arguments passed to them.

My own practice is to only do for subs like those and for a single configuration hashref as the return value for the file when done.

my $config = do "$ENV{HOME}/.foobarc";

After Compline,
Zaxo