diff options
Diffstat (limited to 'local/params.pm')
-rw-r--r-- | local/params.pm | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/local/params.pm b/local/params.pm new file mode 100644 index 0000000..969d0fe --- /dev/null +++ b/local/params.pm @@ -0,0 +1,31 @@ +package local::params; +require Exporter; +use CGI qw(:standard); +use strict; +use base "Exporter"; + +sub new +{ + my $invocant = shift; + my $class = ref($invocant) || $invocant; + # my $self = $class->SUPER::new(@_); + my $self=bless {@_}, $class; + return $self; +} + +sub has_params +{ + my $self=shift; + return param()?1:0; +} + +sub get_as_hash +{ + my $self = shift; + my %result; + for my $key (param) { + $result{$key}=param($key); + } + + return %result; +} |