in reply to Baldly globaling were no-one globaled before.

After looking again at my last comment, it occurred to me that another way of doing it would be to convert your program into an object, and store the data as attributes of the object. Something like this:
package CParsingThingy; sub new { my $class=shift; my $self={}; # you could either do this... $self->{program}={}; # or this: # $self->{functions}=[]; # $self->{typedefs}=[]; # $self->{defined_in}={}; # etc. bless $self, $class; } ... sub parse_program { my $self=shift; my $source=shift; my $program=$self->{program}; # and use $program as before. .. } # etc.
This has the advantages of not using globals and of making it easier, if need be, to have several CParsingThingy's simultaneously. More than once I have written a program thinking "nah, I don't need no stinkin' objects for this" and then find myself going back and giving it an object interface because it makes it so much easier to package, reuse and extend things.

--ZZamboni