A sometimes used technique is to use caller to distinguish between command line invocation as a script and use as a module:
package DualUseScript; ... return 1 if caller; # script "main" code
In reply to Re^3: do script2.pl with parms
by GrandFather
in thread do script2.pl with parms
by tel2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |