http://www.perlmonks.org?node_id=652047


in reply to CGI::Application - alternative to using $self->param?

The CGI::Application way lets you attach data to the object instead of putting it as a global somewhere. This lets you forget *where* you put the data, i.e. in which particular package, and could minimise interactions with other pieces of software.

Elaborating on friedo's suggestion, why don't you simply set the hash as a parameter:

$self->param(hash => { funky => 'Brown' });
somewhere in the beginning, and then retrieve and use it:
sub some_runmode { my $self = shift; my $hash = $self->param('hash'); print "this funky var: $hash->{funky}"; }
like you did before?

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Io ho capito... ma tu che hai detto?