package Module::Name;
# require CGI, strict, constructor, all other code...
# A sub to return a [hash|hash reference] of CGI params.
sub get_params {
my $self = shift;
my %input;
$input{$_} = $self->{$cgi_handle}->param($_)
foreach $self->{$cgi_handle}->param());
# The two possible ways of returning the hash.
# Is there a preference (style or personal)
# as to which one I should use?
return %input; # return hash
# OR
return \%input; # return hash reference
}
####
my $CGI = new Module::Name;
my %INPUT = $CGI->get_params();
print $INPUT{'node'};
##
##
my $CGI = new Module::Name;
my $INPUT = $CGI->get_params();
print $INPUT->{'node'};