I had a need for functionality I'd written in a stand-alone script. The script read two different databases for the corresponding table, and compared the rows, burping out the primary key of the rows which were identical. But it did so in the form of a formatted report. I really didn't want to rewrite the script to produce a parseable output, nor did I want to write the new script to parse the report. So I had the new script require the old one, and "possess" its variables beyond the grave...
use vars '@keywords';
my $h = select(*NULL);
# This script leaves all its results in @keywords,
# and writes a flowery report that we ignore.
# and @keywords has all the stuff we want.
Variable possession after script death
Download Code Replies are listed 'Best First'.
Hmm. How about rewriting the old script so that it consists of one portion that does the work and produces @keywords and another that prints a report? The first part could then be used by both scripts - either as a full blown locally installed module or as a file that's simply required.
It's always a good idea to separate logic from output, even when you're not creating webpages. *grin*