Is %funcN_data something that needs to be declared and kept as information in the main block? Is another function besides funcN going to need that information? If so, it's global data, you should declare it right away. Otherwise, it can be made lexical to funcN by putting the
inside the sub {}'s. If the data in that hash is persistent, this looks like an excellent case for using
-- and now you're into OO Perl, which will probably feel familiar to someone coming from a C++ background.