my $bar = "world"; sub foo { while (@_) { $bar = shift; $params->{$bar} = shift; }