Sorry for all these posts - I'm definitely stuck with this one. (Not even my trusty perl book can help)
I want to use a %globals hash (created in the main script), in a module.
I create the object like:
$db = new Modules::Database (CFG => $cfg, TPL => $tpl, GLOBALS => \%globals);
Right, what I need to be able to do (for the sake of this example) is print all globals like you can do with a normal hash.
I can access individual globals like $self->{GLOBALS}->{KEY} but I can't seem to figure out how to access them all at once.
Ive tried:
%$self->{GLOBALS};
$self->{GLOBALS};
%$self->{GLOBALS}->{globals};
etc......
Could a guru please tell me how I access all keys :)
Thanks a lot.
I want to use a %globals hash (created in the main script), in a module.
I create the object like:
$db = new Modules::Database (CFG => $cfg, TPL => $tpl, GLOBALS => \%globals);
Right, what I need to be able to do (for the sake of this example) is print all globals like you can do with a normal hash.
I can access individual globals like $self->{GLOBALS}->{KEY} but I can't seem to figure out how to access them all at once.
Ive tried:
%$self->{GLOBALS};
$self->{GLOBALS};
%$self->{GLOBALS}->{globals};
etc......
Could a guru please tell me how I access all keys :)
Thanks a lot.