in reply to Open a .pl file form a .pl file
I think that you would be better off looking at the documentation for require rather than using eval. If your first program looks like this.
#! perl -sw use strict; require 'test2.pl'; print weather();
And your second program like this (test2.pl)
#! perl -sw use strict; sub weather { # do stuff to gen data return 'This is the generated data'; } 1;
When test1.pl is run it gives the following output
C:\test>test This is the generated data C:\test>
|
|---|