Do you know where your variables are? | |
PerlMonks |
Re: using require as c like #include?by flounder99 (Friar) |
on Jan 20, 2004 at 13:16 UTC ( [id://322577]=note: print w/replies, xml ) | Need Help?? |
First, there is an error in your example. You are creating $HoH but are dumping %HoH. 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 Either way you will just have to drop the my in hash (or also declare it our if you are using the first example.) -- flounder
In Section
Seekers of Perl Wisdom
|
|