#!/usr/bin/perl -w use strict; use Data::Dumper; sub Statistics {   my %param;   if (ref $_[0] eq 'HASH') {      %param = %{$_[0]};   }   elsif (@_ & 1) {      die 'Not enough arguments';   }   else {      %param = @_;   }   print Dumper(%param); } Statistics( 'Key1','Value1','Key2','Value2' ); my $hashref = {   'Key1' => 'Value1',   'Key2' => 'Value2', }; Statistics( $hashref );