my $cgi = new CGI::Applicaton(...); $::global_var = $cgi; ... use $::global_var now anywhere ... #### ... { package main; our $global_var; # same as $::global_var and $main::global_var ... } #### print $hash{'key'} # same as print $webapp->param('key') $hash{'key'} = 3; # same as $webapp->param('key', 3); #### our %hash; my @all_params = $webapp->param(); for my $p (@all_params) { $hash{$p} = $webapp->param($p); # } ... use %hash instead of calling $webapp->param(...) ...