same namespace as main

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I want to "include" some code in my main. this code should access
variables and functions of the main. can I load code in the same
namespace as the loader is?

---   # or any including module

my $module_name = "path/";
my $var1;
my $obj1 = new Object1;

sub func1 {


do/require? "$module_name";    # dynamicly include some code

package name; # ??

my $var2;
$var1 = some_calculation();   # access variables from main/parent

Re: same namespace as main

Quoted text here. Click to load it

Have a look at:
    perldoc Exporter


Due to the amount of unreadable gibberish being posted from Google Groups,
I seldom read messages posted from there.

Cocoa/Perl: Hire Me:

Site Timeline