in reply to using require as c like #include?
Besides that what is happening is that the code brought in by require is in it's own scope. So the variables declared with my go a way when you leave that scope. This is what our is for. If you are using an older (pre 5.6) version of perl you can use vars
or$ cat HoH.pl use strict; use Data::Dumper; our $HoH; require 'hash'; print Dumper($HoH);
Either way you will just have to drop the my in hash (or also declare it our if you are using the first example.)use strict; use Data::Dumper; use vars qw/ $HoH /; require 'hash'; print Dumper($HoH);
--
flounder
|
|---|