test( eins => 1, zwei => 2, $hashref ); sub test { my $hashref; if ( ref $_[-1] eq 'HASH' ) { $hashref = pop @_; } my %hash = @_; }