if($this_is_not_right) { @_ = (error_code => 123, error_msg => 'this is error'); goto &somewhere; } do_something(); return; sub somewhere { my(%params) = @_; show_error_page($params{error_code},$params{error_msg}); }