in reply to run several scripts in sequence
"do" effectively evals the contents of your files. Require makes sure that you don't include the same file more than once:#!/usr/local/bin/perl do "script1.pl"; do "script2.pl";
Just be careful - you may end up bringing some variables into your namespace Script 1:#!/usr/local/bin/perl require "script1.pl"; require "script2.pl";
and your master code:#!/usr/local/bin/perl use strict; $a = 1;
Of course, you may wish to bring some config settings in this way, but you'd be playing with fire IMHO. Wrapping your scripts in a package will prevent namespace leakage#!/usr/local/bin/perl use strict; do "script1.pl"; do "script2.pl"; print $a;
|
|---|