perl: simplify code to load scripts